开发者

How to get Text value of Label-controls in cells of GridView?

开发者 https://www.devze.com 2023-02-16 00:13 出处:网络
In my GridView there is a column containing Label-controls as val开发者_如何学运维ue. I need to know how to access each Label-control to get its Text value. Any help is appreciated.You can store its v

In my GridView there is a column containing Label-controls as val开发者_如何学运维ue. I need to know how to access each Label-control to get its Text value. Any help is appreciated.


You can store its value in a hidden field and place it in any other column. Then when you retrieve that row value you can access that hiddenfield value


handle selectedIndexChanged event and in it do

string text = ((Label)grid.SelectedRow.Cells[cellIndex]).Text;

string text = grid.SelectedRow.Cells[0].Text; // this should do the trick
0

精彩评论

暂无评论...
验证码 换一张
取 消