开发者

extracting data from a SpGridView selected row

开发者 https://www.devze.com 2022-12-27 07:30 出处:网络
Using SPGridView, I want to fill textboxes with the SPGridview Selected Row Data on a button click event.

Using SPGridView, I want to fill textboxes with the SPGridview Selected Row Data on a button click event.

txtCode= SPGridView.SelectedRow.Cell[1].Text;

On debugging, it shows Cell[1] is empty but it is showing data in the Grid.

How can this b开发者_运维技巧e achieved?


I've just got similar problem. And I've find out that "selectedvalue" is solution. so try :

txtCode.Text = Convert.ToString(oSPGridView.SelectedValue);


Remember that cell index start at 0.

you can also try this

((TextBox)SPGridView.Rows[SPGridView.SlectedIndex].Cells[1].Controls[0]).Text;
0

精彩评论

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