V
VMI
Hi,
I have a Windows datagrid that's attached to a filled datatable. The grid
also has a tablestyle. Since the data from the grid comes from a
datatatable, how can I retrieve the data from a specific table row once a
user clicks on a grid row? I already have the code that lets me know what
grid row the user clicked on, but, for example, if I want to retrieve the
value of the 5th column in the grid, I'm currently using myGrid[rowNum,
4].ToString(). But If I decide to change the position of "Name" to column 8,
I'll have to change this code (eg. myGrid[rowNum, 7].ToString() ). Is there
any other alternative?
Thanks.
I have a Windows datagrid that's attached to a filled datatable. The grid
also has a tablestyle. Since the data from the grid comes from a
datatatable, how can I retrieve the data from a specific table row once a
user clicks on a grid row? I already have the code that lets me know what
grid row the user clicked on, but, for example, if I want to retrieve the
value of the 5th column in the grid, I'm currently using myGrid[rowNum,
4].ToString(). But If I decide to change the position of "Name" to column 8,
I'll have to change this code (eg. myGrid[rowNum, 7].ToString() ). Is there
any other alternative?
Thanks.