1
我有以下的中繼器包含一個單選按鈕:禁用單選按鈕內部repeater項目
<asp:Repeater ID="RptLeaveRequests" runat="server"
onitemdatabound="RptLeaveRequests_ItemDataBound">
<ItemTemplate>
<table id="tableItem" runat="server">
//displaying other data which is not relevant to qeustion
<td style="50px">
<asp:RadioButtonList ID="rbtVerified" runat="server" >
<asp:ListItem Value="1">Accept</asp:ListItem>
<asp:ListItem Value="2">Reject</asp:ListItem>
</asp:RadioButtonList>
</td>
<td>
<asp:TextBox ID="txtNotes" runat="server" ></asp:TextBox>
</td>
</tr>
</table>
</ItemTemplate>
</asp:Repeater>
查閱數據正在從該方法填充中的代碼:
DataTable dt = new LeaveLogic().GetManagerUnverifiedLeaveRequests(Convert.ToInt32(Context.User.Identity.Name));
if (dt.Rows.Count > 0)
{
RptLeaveRequests.DataSource = dt;
RptLeaveRequests.DataBind();
}
如何可以循環通過每個如果從數據庫(和DataTable dt)檢索到的記錄爲ReadOnly
爲真,則禁用/隱藏單選按鈕?
這應該放在Repeater_ItemDataBound
方法或其他地方嗎?