Click to See Complete Forum and Search --> : Null value on ButtonList


simonevaristo
July 21st, 2006, 12:28 PM
Hi

I have a RadioButtonList Control and I dont have any Item selected.
Is there an instruction that validates if you selected an Item or Not from this RadioButtonList Control???

I would expect something like this :
RadioButtonList1.AnyItemSelected=True

Any ideas??
Thanx กก

Fishdawg65
July 21st, 2006, 12:38 PM
I think SelectedIndex is what you're looking for.


RadioButtonList rbl = new RadioButtonList();
if (rbl.SelectedIndex != -1)
{
//Code when RadioButtonList has been selected
}
else
{
//Code when RadioButtonList has NOT been selected
}


If this helps, please rate my post.