Reputation: 443
I am making a form in which I have 2 radio buttons rows. I checked radio button I one row, but when I checked radio button in 2nd row first one unchecked. and I have put condition on radio button that on check textfield.enabled should be true.. this condition is also not working...
public partial class EntryForm : Form
{
public EntryForm()
{
InitializeComponent();
if (OfferReceived.Checked == true || CAS.Checked == true)
{
TxtRefNo.Enabled = true;
}
}
private void TxtVfs_Enter(object sender, EventArgs e)
{
}
private void btnsubmit_Click(object sender, EventArgs e)
{
}
So, where do I have to put this condition?
Upvotes: 0
Views: 1810
Reputation: 15253
Radio Buttons are mutually exclusive. If you want multi-selection use Check Boxes instead.
Upvotes: 1
Reputation: 3720
Add each radio button group (or row) in its own container (use a Panel, a TableLayoutPanel or something similar). This way, you can have a radio button selected from each group.
Otherwise, there should not be more than one radio button selected at a time in each group; that's the whole point of a radio button.
Upvotes: 4