更新时如何在gridview中访问标签值 [英] How to access the lable value in gridview while updating

查看:67
本文介绍了更新时如何在gridview中访问标签值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我以这种方式设计了一个gridview,同时单击更新,除了雇员id(标签)以外的所有其他字段为文本框.
现在,我无法访问雇员ID的值来更新行.

因此,请说明如何在网格视图中从标签控件获取值.

如果您有任何示例,请发送一个示例.

I designed a gridview in such a way, while clicking on update except employee id (label) all other fields as textbox.
Now i am unable to access the value of employee id to update the row.

So, please tell how to get the value from label control in grid view.

If u have any examples please send one example.

推荐答案

将GridView的datakeynames属性设置为EmployeeID.

您可以使用 GridView访问GridView的DataKey值. DataKeys属性 [ ^ ]

希望这会有所帮助!
Set datakeynames property of GridView as EmployeeID.

You can access the DataKey value of a GridView using GridView.DataKeys Property[^]

Hope this helps!


这篇关于更新时如何在gridview中访问标签值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆