RadioButtonList

mac4_life

Member
Joined
Jun 21, 2005
Messages
13
Programming Experience
1-3
I have a RadioButtonList on my webform with 4 items in it. When the user clicks on the OK button, it does a different thing depending on which radio button is selected. It does this by performing a SELECT CASE on the SelectedIndex. It works fine now, but what I want to do is add functionality to test for a certain condition at form load, and if the condition is true, I want to force the user to have the 4th item selected, and not let them change it. The following code works if I comment out the .visible=false statement. When I try to disable the control or make it invisible, it sets the selecteditem/selectedtext back to the first item.

VB.NET:
rdoNewEdit_Reg.Visible = False
rdoNewEdit_Reg.Items("3").Selected = True

Any advice on how to make this work? TIA!

MAC
 
After you set the item you want to TRUE, disable the control by setting its .Enabled to FALSE.

That should work without any problems. If it still does not, post some code showing what your testing for at page_load and how your setting the selected item.

Blokz
 
Back
Top