asp.net RadioButtonList 选项的数据绑定问题
在Listview中每行有一个题干和4个选项 选项由RadioButtonList来做。
4个选项对应表的4个字段,由于RadioButtonList没有DataBind,无法进行绑定
在aspx.cs里面想用FindControl来对RadioButtonList的ITEM直接赋值可是FindControl返回null...
应该怎么写,写在哪个事件里?是Listviewcreated里面么?
<asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1"
style="margin-top: 0px">
<LayoutTemplate>
<table id="Table2" runat="server" style="border" cellpadding="0" width="700">
<tr runat="server" id="Tr3">
<th id="Th2" runat="server" >
</th>
</tr>
<tr runat="server" id="groupPlaceholder" />
</table>
</LayoutTemplate>
<GroupTemplate>
<tr runat="server" id="QuizRow">
<td runat="server" id="itemPlaceholder" />
</tr>
</GroupTemplate>
<ItemTemplate>
<td id="Td3" align="left" style="width:700px" runat="server" >
<asp:Hyperlink ID="Link" runat="server"
Text='<%# Eval("题干") %>'
Target="_blank"
/>
<br />
<asp:RadioButtonList runat="server" id="RadioList" CellPadding="20" RepeatColumns="4">
<asp:ListItem Value="1"></asp:ListItem>
<asp:ListItem Value="2"></asp:ListItem>
<asp:ListItem Value="3"></asp:ListItem>
<asp:ListItem Value="4"></asp:ListItem>
</asp:RadioButtonList>
</td>
</ItemTemplate>
</asp:ListView>