How do I get a DataRow from a row in a DataGridView

Viewed 64264

I'm using a databound Windows Forms DataGridView. how do I go from a user selected row in the DataGridView to the DataRow of the DataTable that is its source?

4 Answers

In Visual Studio 2017 .NET 4.5, I had success with

 var row = (DataRowView) e.Row.DataItem;
Related