I have a DataTable bound to a DataGridView. I have FullRowSelect enabled in the DGV. Is there a way to get the selected row as a DataRow so that I can get strongly typed access to the selected row's values?
When a row is selected in a GridView control, use the SelectedRow property to retrieve the GridViewRow object that represents that row. This is the same as retrieving the GridViewRow object at the index specified by the SelectedIndex property from the Rows collection.
Text = Convert. ToString(frm. DataGridView1[1, row]. Value);
DataRowView currentDataRowView = (DataRowView)dgv1.CurrentRow.DataBoundItem
DataRow row = currentDataRowView.Row
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With