日期:2014-05-17 浏览次数:20470 次
<asp:TemplateField HeaderText="选中">
<ItemTemplate>
<input id="ID" type="checkbox" runat=server />
</ItemTemplate>
<ItemStyle HorizontalAlign="Center" />
</asp:TemplateField>
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
//首先判断是否是数据行
if (e.Row.RowType == DataControlRowType.DataRow)
{
CheckBox ck = (CheckBox)e.Row.FindControl("ID");
//这里应该怎么给这个checkbox的value赋值呢
}
if (e.Row.RowType == DataControlRowType.DataRow)
{
HtmlInputCheckBox ck = e.Row.FindControl("ID") as HtmlInputCheckBox;
//这里应该怎么给这个checkbox的value赋值呢
}