Simple Datagrid questions

  • Thread starter Thread starter Philip Tepedino
  • Start date Start date
P

Philip Tepedino

Hi,

I have a datagrid setup to do full-row select. When I select a row, I need
to be able to know what the value of the current row's column X is.. how can
I find the value of a specific column when a row is selected?

i'm very used to VB6's listview, and am trying to learn the datagrid, but it
just seems overly complicated for very simple things.

Any help would be appreciated,

Philip Tepedino
 
This might help:

// Get the BindingManagerBase of the DataTable.
BindingManagerBase bindingMgrBase =
this.BindingContext[myDataSet.myDataTable];
// Get a DataRowView of the selected row of the DataGrid.
DataRowView drv = (DataRowView)bindingMgrBase.Current;
// Get the DataRow from the DataRowView.
DataRow myDataRow = drv.Row;
// Get the DataColumn from the DataRow.
DataColumn dc = myDataRow["ColumnName"];


I'm not sure that's exactly right. Anyway, you need to use the Data Binding
stuff.
 
Back
Top