Information générale
Titre:
Datagrid: Retreiving a value from a column
HI,
I want to be able to choose from values of a pick list (datagrid) and get the ID selected. I then use this ID to query other tables.
I use this code to get a value from a tables's column:
DataRowCollection drcol = oDs.Tables["MyTable"].Rows;
DataRow dr = drcol[0];
string sID= dr["MyColumn"].ToString();
My problem is that the row I want to get will not be the first one of the pick list. How can I rettrive a row # from the datagrid? I tried the CurrentRowIndex property but if the user sort the grid using the column header, the row index returned will not match the one in the source table.
Thank you for your help,
Christian
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement