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
[quoted text, click to view] "William Ryan eMVP" <bill@NoSp4m.devbuzz.com> wrote in message
news:O4VxyQ4IEHA.364@TK2MSFTNGP11.phx.gbl...
> You can use the ColumnIndex of the CurrentCell property to reference the
> underlying datatable's colum.columnName property. So if ColumnIndex of
the
> current cell is 1, then you can use DataTable.Columns(1).ColumnName to get
> this info. You can just substitute it where I hard coded 1.
>
> HTh,
>
> Bill
> "Strahimir Antoljak" <strah@netzero.net> wrote in message
> news:OiUc7K2IEHA.964@TK2MSFTNGP10.phx.gbl...
> > Is it possible (and how?) to get the data grid column name
> > based on the DataGrid.CurrentCell?
> >
> > The DataGrid has assigned a TableStyle comprising
> > selected columns (DataGridTextBoxColumn) from
> > the source DataTable (DataGrid.DataSource=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
> >
> >
>
>