Windows Forms Datagrid

  • Thread starter Thread starter Bernard
  • Start date Start date
B

Bernard

HI,

I have a Datagrid with some columns,... anyone knows how
can I retrieve the values of the selected row?

Thanks,
 
Hi Bernard,

Look at the code snippet below:

CurrencyManager cm = (CurrencyManager)this.BindingContext[
dataGrid.DataSource,
dataGrid.DataMember];
DataView view = (DataView)cm.List;

string customerName = view[cm.Position]["CustomerName"]
 
Back
Top