I've tried using a RadioButtonList, but am unable to figure out how to make the data binding work. My table has the following columns: ID, SurveyID, Text, OptionA, OptionB, OptionC, and OptionD, and I need to display the four options for each question. However, the data binding would only allow me to choose one column.
Main Topics
Browse All Topics





by: guru_samiPosted on 2009-08-19 at 13:19:02ID: 25136870
You can use RadioButtonList instead of 4 RadioButton and grouping them...and then get the value of the Selected RadioButtonItem like below:
em) tonList"); ();
/QuickStar tv20/aspne t/doc/ctrl ref/ standa rd/radiobu ttonlist.a spx
foreach (DataListItem item in DataList1.Items)
{
if (item.ItemType == ListItemType.Item ||item.ItemType == ListItemType.AlternatingIt
{
RadioButtonList rbl =(RadioButtonList) item.FindControl("RadioBut
if (rbl != null)
{
string selectedValue = rbl.SelectedValue.ToString
}
}
}
Now again you did not mention when and where you are trying to retrieve this value...
the code above loops through all the DL items.
REF: http://quickstarts.asp.net