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!
精彩评论