On GridView1 RowDataBound how can I get something like this :
SELECT * FROM tableName WHERE Column AND DataTableID=RowEditIndex.
I’m trying to get the value of a cell from dataTable of the current editing row . so he needs to get the value from a certain cell of datTable of the current editing row of the gridview.
I need the correct sql statment and I need it in rowDataBound gridview cuz I have another code there.
thanks
You can achieve this using data keys on the GridView, like this:
And in the code-behind:
EDIT: Here’s an example of how you can access a data key in the
RowUpdatingevent:You can also access the value through the
DataItemproperty in theRowDataBoundevent: