0

[I have an application where , i have a radiobuttonlist having 2 radio buttons radiobuttons RB1 & RB2
and there are 6 checkBoxes CB1 thru CB6
If RB1 is selected then CB6 shld be disable /invisible and if RB2 is selected then all the CBs shld be enabled. How do i do this?

protected void rb_OnIndexChanged(object sender, System.EventArgs e)
	{				
if (rb.SelectedValue=="A")
	{
	cb6.Enabled=true;
	}
	}

i get an error Object reference not set to an instance of an object
plz help.
thank you

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by C#Novice
0

try this :

private void RB1_CheckedChanged(object sender, System.EventArgs e)
{
	if (RB1.Checked == true)
	{
		C1.Enabled = true;
		C2.Enabled = true;
		C3.Enabled = true;
		C4.Enabled = true;
		C5.Enabled = true;
		C6.Enabled = false;
	}
}

private void RB2_CheckedChanged(object sender, System.EventArgs e)
{
	if (RB2.Checked == true)
	{
		C1.Enabled = false;
		C2.Enabled = false;
		C3.Enabled = false;
		C4.Enabled = false;
		C5.Enabled = false;
		C6.Enabled = false;
	}
}
0

thnx Jx_Man. i will surely try this tomorrow. and let u know.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.