i have grid view, which is not auto generated columns. In grid view there are 3 columns one for checkbox(to delete selected row from datatable) one for edit link button(to edit current row) and the third one is for showing data from datatable.
I am binding it from datatable. I have a primary key in datatable. Now my problem is when I am clicking on edit link button I am not getting primary key(id) from datatable for selected row in grid view (i think row is not selected when i am clicking on edit link button). I cant take row index to match it with datatable primary key as data bound in grid view is filtered.
what I tried is, I created one more column in grid view as hidden which is primary key column from datatable. But for that too I am not getting data in hidden column of row which is clicked for edit.
some one plz help with new idea or solution for what i am trying.. thanx in advance....
Loading
Krishna GaradPosted Feb 9, 2012, 4:14 AM
GridViewRow row = (GridViewRow)GridView1.Rows[e.RowIndex];
int _id=Convert.ToInt32(GridView1.DataKeys[row.RowIndex].Value.ToString());
//further use it