您的位置:首页 > 其它

获取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;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: