thanks Hth but this would not work in my
case as I am using a TableStyle comprising
selected columns from the DataTable, which
means ColumnIndex property of the CurrentCell
does not necessarily match the column index
in the DataTable; the DataTable has 11 columns
while TableStyle can have any number of columns
between 2 and 11 - so I create TableStyle that
contains 2nd, 4th and 8th column in the DataTable,
but in DataGrid they have indices 0, 1, 2.
Thanks again,
--
Strah @ Langan
"William Ryan eMVP" <bi**@NoSp4m.de vbuzz.com> wrote in message
news:O4******** *****@TK2MSFTNG P11.phx.gbl...
You can use the ColumnIndex of the CurrentCell property to reference the
underlying datatable's colum.columnNam e property. So if ColumnIndex of
the current cell is 1, then you can use DataTable.Colum ns(1).ColumnNam e to get
this info. You can just substitute it where I hard coded 1.
HTh,
Bill
"Strahimir Antoljak" <st***@netzero. net> wrote in message
news:Oi******** *****@TK2MSFTNG P10.phx.gbl... Is it possible (and how?) to get the data grid column name
based on the DataGrid.Curren tCell?
The DataGrid has assigned a TableStyle comprising
selected columns (DataGridTextBo xColumn) from
the source DataTable (DataGrid.DataS ource=DataTable ).
I would like to be able to get the column name of the
datagrid based on the DataGrid current cell so I can reference
the appropriate column in the source DataTable.
Thanks,
--
Strah @ Langan