获取GridView绑定的数据值(没显示出来的字段)
2013-05-16 09:04
295 查看
前台
<asp:TemplateField HeaderText="排序号" Visible="False">
<ItemTemplate>
<asp:Label ID="SortId" runat="server" Text='<%# Eval("sortid") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
后台
Button mySelectButton = (Button)sender;
int rowindex = ((GridViewRow)mySelectButton.NamingContainer).RowIndex;
Label1.Text = (this.GridView1.Rows[rowindex].FindControl("SortId") as Label).Text;
<asp:TemplateField HeaderText="排序号" Visible="False">
<ItemTemplate>
<asp:Label ID="SortId" runat="server" Text='<%# Eval("sortid") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
后台
Button mySelectButton = (Button)sender;
int rowindex = ((GridViewRow)mySelectButton.NamingContainer).RowIndex;
Label1.Text = (this.GridView1.Rows[rowindex].FindControl("SortId") as Label).Text;
相关文章推荐
- GridView中绑定DropDownList并用DropDownList显示对应字段数据;
- 界面对应字段,绑定数据到gridview 显示 及删除功能 窗体事件 分页及键
- asp.net GridView 后台绑定数据无数据显示表头及没有数据一行
- 在数据绑定控件的DataBound事件中获取某绑定字段值
- 使用ExtJS GridPanel从Web Service 获取、绑定和显示数据
- GridView 绑定数据显示段日期格式
- asp.net gridview 绑定图片字段,图片不显示
- [Asp.Net]GridView绑定并且无数据时保持显示列头
- GridView 绑定字段根据内容为空时格式化显示
- 使用vue框架 Ajax获取数据列表并用BootStrap显示出来
- 读取Excel数据绑定到Gridview进行显示
- GridView绑定数据库中bit型的数据显示成0和1而不是True和False
- 异步获取数据Ajax,以及对获取的数据进行绑定(显示在页面上)
- gridview 绑定数据为空时,表头部分内容显示的解决方法
- VC通过ADO打开SQL SERVER数据库,并将其中的表、字段、数据显示出来的小程序
- Ajax实现无刷新的获取数据并绑定到GridView,以及无刷新更新数据
- ASPxGridview总结(ASPxGridView的增,删,改,查,数据绑定,外观显示,功能设定,分页)
- ajax 获取 后台数据,前端 select option中显示出来
- 使用ExtJS GridPanel从Web Service 获取、绑定和显示数据
- gridview中设置绑定的日期时间类型字段的显示格式