Does anyone know how to dynamically set a default RadioButton selection?
I am looping through a "for each" loop to dynamically add radiobuttons with a RadioButtonsList object. When a value being added is the same as a previously stored value, I would like that item in the RadioButtonList to be selected by default.
Below is some example code:
Dim s as String = "some data"
Dim o as Object
Dim al as ArrayList
// At this point an ArrayList is returned with
// values to be stored in RadioButtonList
For each o in al
RadioButtonList.Items.Add(o)
if(s.compare(s, o.Gettype.ToString)) Then
// I want THIS radio button to be selected
// automatically
end if
Next
Thanks in advance for any help.
I am looping through a "for each" loop to dynamically add radiobuttons with a RadioButtonsList object. When a value being added is the same as a previously stored value, I would like that item in the RadioButtonList to be selected by default.
Below is some example code:
Dim s as String = "some data"
Dim o as Object
Dim al as ArrayList
// At this point an ArrayList is returned with
// values to be stored in RadioButtonList
For each o in al
RadioButtonList.Items.Add(o)
if(s.compare(s, o.Gettype.ToString)) Then
// I want THIS radio button to be selected
// automatically
end if
Next
Thanks in advance for any help.