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
256105-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
SelectedIndexChanged
event 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:
SelectedIndexChanged
event is raised when the SelectedIndex property of the RadioButtonList control changes.SelectedItem
property of the RadioButtonList control returns the selected radiobutton.Text
property 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.