MessageBox.Show( (string)((DataRowView)dr.DataBoundItem).Row["town"] ); // or MessageBox.Show( ((myDS.myTbRow)((DataRowView)dr.DataBoundItem).Row).town ); // or if you know the index MessageBox.Show((string)dr.Cells[index].Value);BindingSource sounded to be a better alternative to me too. However unless I was doing it wrong it is no less work. Would you share the syntax? Mine looked like:
string v1 = ((myDS.myTbRow)((DataRowView)myTbBindingSource.Current).Row).town; string v2 = (string)((DataRowView)myTbBindingSource.Current).Row["town"];Both doesn't look like less work than using dr.DataBoundItem. dr.DataBoundItem and myTbBindingSource.Current both point to same thing.
DataGridViewRow dr = myDataGridView.CurrentRow;
>MessageBox.Show( (string)dr["town"]
>DataGridViewRow dr = myDataGridView.CurrentRow; >MessageBox.Show( Convert.ToString( dr.Cells["MyColDataGridViewTextBoxColumn"])); > > // is the "GridViewTextBoxColumn needed? Don't know > >// or > >MessageBox.Show( Convert.ToString( dr.Cells[ColNumber]));>