我需要弄清楚如何在GridView中绑定CheckBox值,我在GridView中编写了CheckBox.Checked = DataBinder.Eval(Container.DataItem,“IsSubscribed”),但是即使IsSubscribed为false,也会检查CheckBox.
@H_301_2@在页面回发之前,我已经在Page_Load中绑定了网格.这是我的代码:
<asp:TemplateField HeaderText="Select"> <ItemTemplate> <asp:CheckBox ID="chkIsSubscribed" runat="server" HeaderText="IsSubscribed" Checked='<%# DataBinder.Eval(Container.DataItem,"IsSubscribed") %>'/> </ItemTemplate> </asp:TemplateField>@H_301_2@谢谢.