I'm developing a WPF desktop application and I'm trying to have a
DataGrid
where certain columns have a ToolTip that is from a property on a ViewModel object stored in each "cell" of the
DataTable
that is the
ItemsSource
for the
DataGrid
. I'm AutoGenerating the columns because there are not a fixed number of columns in the data.
I previously asked about the precedence of
RowStyle
and
DataGridColumn.CellStyle
(
Does DataGrid.RowStyle override DataGridColumn.CellStyle?[
^]) and determined that it appears the
CellStyle
takes precedence.
I can't seem to figure out how, from the XAML of the
Style
used as the
CellStyle
, to bind to a property on the actual source object (ViewModel) for the cell.
A
DataGridCell
doesn't appear to have a path to access to the source object.
Is there a better way to accomplish what I'm attempting?