前台:
<asp:GridView ID="GV" runat="server" AutoGenerateColumns="False" Height="1px"
Style="z-index: 100; left: 8px; position: absolute; top: 8px" Width="800px" CellPadding="4" Font-Size="Small" ForeColor="#333333" AllowSorting="True">
<Columns>
<asp:TemplateField HeaderText="人员编码">
<ItemTemplate>
<a href="#" onclick="ShowValue(this);"><%#Eval("人员编码")%></a>
</ItemTemplate>
<ItemStyle Width="80px" />
</asp:TemplateField>
<asp:BoundField DataField="姓名" HeaderText="姓名" >
<ItemStyle Width="60px" />
</asp:BoundField>
<asp:BoundField HeaderText="出勤工日" >
<ItemStyle Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="小计" >
<ItemStyle Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="病假" >
<ItemStyle Width="15px" Wrap="True" />
</asp:BoundField>
<asp:BoundField HeaderText="事假">
<ItemStyle Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="婚假">
<ItemStyle Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="产假">
<ItemStyle HorizontalAlign="Right" Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="丧假">
<ItemStyle Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="探亲假">
<ItemStyle Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="年休假">
<ItemStyle Width="15px" Wrap="True" />
</asp:BoundField>
<asp:BoundField HeaderText="看护假">
<ItemStyle Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="节育假">
<ItemStyle Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="工伤假">
<ItemStyle Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="迟到早退">
<ItemStyle Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="本月扣分">
<ItemStyle Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="累计扣分">
<ItemStyle Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="摘要">
<ItemStyle Width="100px" />
</asp:BoundField>
</Columns>
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#EFF3FB" />
<EditRowStyle BackColor="#2461BF" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>请问:第一列控件好像没有id,后台要怎样才能遍历gridview所有记录并获取第一列模板列"人员编码"的值,请大侠提供vb.net后台代码
<asp:GridView ID="GV" runat="server" AutoGenerateColumns="False" Height="1px"
Style="z-index: 100; left: 8px; position: absolute; top: 8px" Width="800px" CellPadding="4" Font-Size="Small" ForeColor="#333333" AllowSorting="True">
<Columns>
<asp:TemplateField HeaderText="人员编码">
<ItemTemplate>
<a href="#" onclick="ShowValue(this);"><%#Eval("人员编码")%></a>
</ItemTemplate>
<ItemStyle Width="80px" />
</asp:TemplateField>
<asp:BoundField DataField="姓名" HeaderText="姓名" >
<ItemStyle Width="60px" />
</asp:BoundField>
<asp:BoundField HeaderText="出勤工日" >
<ItemStyle Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="小计" >
<ItemStyle Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="病假" >
<ItemStyle Width="15px" Wrap="True" />
</asp:BoundField>
<asp:BoundField HeaderText="事假">
<ItemStyle Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="婚假">
<ItemStyle Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="产假">
<ItemStyle HorizontalAlign="Right" Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="丧假">
<ItemStyle Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="探亲假">
<ItemStyle Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="年休假">
<ItemStyle Width="15px" Wrap="True" />
</asp:BoundField>
<asp:BoundField HeaderText="看护假">
<ItemStyle Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="节育假">
<ItemStyle Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="工伤假">
<ItemStyle Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="迟到早退">
<ItemStyle Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="本月扣分">
<ItemStyle Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="累计扣分">
<ItemStyle Width="15px" />
</asp:BoundField>
<asp:BoundField HeaderText="摘要">
<ItemStyle Width="100px" />
</asp:BoundField>
</Columns>
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#EFF3FB" />
<EditRowStyle BackColor="#2461BF" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView>请问:第一列控件好像没有id,后台要怎样才能遍历gridview所有记录并获取第一列模板列"人员编码"的值,请大侠提供vb.net后台代码
解决方案 »
- 关于文件上传不能获取"file"表单的问题
- 是在厦门或福州的.net程序员就加进来,聊聊创业,技术之类的问题!QQ群号:12949398
- 兄弟我javascript学得不精,也搞asp.net开发,请问兄弟们,只用c#,dreamweavear等,能搞asp.net开发吗?
- 菜鸟问题,还请指点
- 生成的静态页面在查看其源文件时的问题,请高手指教!!
- 点击按钮跳到页面的某个层的位置(锚点)急急
- 类别和新闻显示问题
- 查询结果用GridView绑定
- 疑问?javascript,asp,html,
- 请问SetAttribute(string key,string value)和FromString(string value)怎么用?
- gridview 模板列取值问题
- 母板页问题
String _ids = "";
for (int i = 0; i < Gridview1.Rows.Count; i++)
{
_ids+= int.Parse(Gridview1.Rows[i].Cells[1].Text) + ",";
}
protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
{
string id = GridView1.Rows[e.NewEditIndex].Cells[0].Text;
Response.Redirect("TempletEdit.aspx?id=" + id);
}