Hi,
I'm having problems binding a RadioButtonList...
I have values 1-10 stored as an integer in a field called score. I am using a DataList control to display records.
I want the respective RadioButton to be checked based on the score.
ie. if score = 3 the radiobutton with value 3 should be checked.
When I databind the RadioButtonList however I get this error:
"An invalid data source is being used for RBScore. A valid data source must implement either IListSource or IEnumerable."
<asp:radiobuttonlist id=RBScale runat="server" DataSource='<%# DataBinder.Eval(Container, "DataItem.Score") %>' RepeatDirection="Horizontal">
<asp:ListItem Value="1">1</asp:ListItem>
<asp:ListItem Value="2">2</asp:ListItem>
<asp:ListItem Value="1">3</asp:ListItem>
etc...
</asp:radiobuttonlist>
Any ideas?
I'm having problems binding a RadioButtonList...
I have values 1-10 stored as an integer in a field called score. I am using a DataList control to display records.
I want the respective RadioButton to be checked based on the score.
ie. if score = 3 the radiobutton with value 3 should be checked.
When I databind the RadioButtonList however I get this error:
"An invalid data source is being used for RBScore. A valid data source must implement either IListSource or IEnumerable."
<asp:radiobuttonlist id=RBScale runat="server" DataSource='<%# DataBinder.Eval(Container, "DataItem.Score") %>' RepeatDirection="Horizontal">
<asp:ListItem Value="1">1</asp:ListItem>
<asp:ListItem Value="2">2</asp:ListItem>
<asp:ListItem Value="1">3</asp:ListItem>
etc...
</asp:radiobuttonlist>
Any ideas?