G
Guest
Visual Studio 2003 .Net / C#
I have a datagrid, which is bound to a dataset at runtime when my page
loads. When the user double clicks a row, I need to find out which row they
have selected so I can pass the key value onto another page, which is showing
me more details for the selected row. So in the double click event of the
datagrid I have this code:
DataRow CurrentRow = dsJobList.Tables[0].Rows[dgJobs.CurrentRowIndex];
This generally seemed to be working. BUT.....when the user sorts the
Datagrid by clicking on one of the column headings things go screwy! They
double click for example on row 3, which on the service is now Job number 8
as they are sorting the grid on another value. But row 3 in my dataset is
not Job 8, it is Job 3!
How can I get round this? Is there a better way of getting the selected row
out of datagrid??
Thanks
Steve
I have a datagrid, which is bound to a dataset at runtime when my page
loads. When the user double clicks a row, I need to find out which row they
have selected so I can pass the key value onto another page, which is showing
me more details for the selected row. So in the double click event of the
datagrid I have this code:
DataRow CurrentRow = dsJobList.Tables[0].Rows[dgJobs.CurrentRowIndex];
This generally seemed to be working. BUT.....when the user sorts the
Datagrid by clicking on one of the column headings things go screwy! They
double click for example on row 3, which on the service is now Job number 8
as they are sorting the grid on another value. But row 3 in my dataset is
not Job 8, it is Job 3!
How can I get round this? Is there a better way of getting the selected row
out of datagrid??
Thanks
Steve