Last Updated: February 25, 2016
·
2.293K
· hjwu

Get the current row in DataTable

Check the below code snippet.

CurrencyManager cm = (CurrencyManager) this.BindingContext[this.gridDataBoundGrid.DataSource, this.gridDataBoundGrid.DataMember];
DataRow dr = ((DataRowView) cm.Current).Row;
this.label1.Text = dr["Col"].ToString();

Reference : How do I locate the current row in my DataTable after the GridDataBoundGrid has been sorted or filtered?