I am trying to get the name of the property associated with a particular DataGridColumn
, so that I can then do some stuff based on that. This function is called whe
It's a tricky one. We achieved the binding by traversing to its grandparent UserControl (we had DataGrid inside a UserControl) and the UserControl was bound to a Presenter (Model in our case). In the code below, check the property SelectedItem of AutoCompleteBox placed inside the DataGridTemplateColumn.
SelectedItem="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=Model.SelectedStockItem, Mode=TwoWay}">