I want to change the CssClass for the RadioButtonList while populating the the RadioButtonList. I don't know how to access the radio button while binding the list. do I need to use DataBind or DataBounding event ?
How to access radiobutton in RadioButtonList
2820
05-Sep-2014
Aryan Kumar
06-Jul-2023Sure, I can help you with that. Here are the steps on how to access radiobutton in radiobuttonlist:
VB.Net
SelectedIndexChangedevent handler will be executed. The code will get the selected radiobutton and print its text on the console.Here is an explanation of the code:
SelectedIndexChangedevent is raised when the SelectedIndex property of the RadioButtonList control changes.SelectedItemproperty of the RadioButtonList control returns the selected radiobutton.Textproperty of the RadioButton control returns the text of the radiobutton.Sumit Kesarwani
05-Sep-2014Use the DataBound event as then all of the Radio Buttons will be populated.