Get the corresponding row in the datatable from the selection in datagridview
- by The King
Hi All,
I have a DataTable which is bound to datagridview (Winforms)... I use the following two lines to get the DataRow that is selected in the datagridview...
int l_intSelectedRow = DataGridView1.SelectedRows[0].Index;
DataRow l_drwSelectedRow = ControlGroupPostedItems.Tables["PostedItems"].Rows[l_intSelectedRow];
This works…