<asp:GridView ID="PageGrid" runat="server" AutoGenerateColumns="False" CssClass="dgv"Width="100%" DataKeyNames="Id" OnRowDataBound="PageGrid_RowDataBound">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="chkitem" runat="server" />
</ItemTemplate> <HeaderStyle Width="30px" />
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Label ID="lblRowNumber" runat="server" Text='<%# Container.DataItemIndex + 1 %>'></asp:Label>
<asp:HiddenField ID="hfReimId" runat="server"></asp:HiddenField>
</ItemTemplate>
<HeaderStyle Width="30px" />
</asp:TemplateField>
<asp:TemplateField HeaderText="填写时间"> <ItemTemplate>
<asp:TextBox ID="txtFillDate" CssClass="easyui-datebox" runat="server" Width="120px" Text='<%# Eval("FillDate") %>'></asp:TextBox>
</ItemTemplate> <HeaderStyle Width="80px" /> </asp:TemplateField>
</Columns>
</asp:GridView>
2 回答
呼如林
TA贡献1798条经验 获得超3个赞
DataKeyNames表示主键的列名,可以通过GridViewEntity.DataKeys[RowIndex]["ColumsName"]来获取它的值
- 2 回答
- 0 关注
- 511 浏览
添加回答
举报
0/150
提交
取消