开发者

when i select row in gridview i get another result

i have gridview in my asp.net webform, and if i select row

  • after the database is refreshed i see the ID correct.

but when i run any query on the data and i see for example 4 rows

and i select one row i see wrong ID

i use this for select row: ID = GridView1.SelectedRow.Cells[1].Text;开发者_高级运维

what can be wrong ?

thanks


Is the ID row the first column in your gridview? If yes, try using SelectedRow.Cells[0].Text.

You may also want to take a look at this link:

http://www.dotnetfunda.com/articles/article442-how-to-get-the-values-of-selected-row-from-a-gridview-using-aspnet-.aspx

Hope it helps!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜