开发者

extracting data from a SpGridView selected row

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜