Like I mentioned in previous question here that how to get value for DataGridTextColumn
where i suggested to use Column.Binding.Path.Path
to get bound property name.
But that won't work in this case since DataGridComboBoxColumn
does not have any binding property. If syntax is like the one you mentioned in question above, you can get like this:
For SelectedValue
i.e. Company
:
<Button Command="{Binding DataContext.OpenFilterCommand,
RelativeSource={RelativeSource AncestorType=UserControl}}"
CommandParameter="{Binding
Column.EditingElementStyle.Setters[1].Value.Path.Path,
RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
EXPLANATION
TemplatedParent (DataGridColumnHeader) --> Column (DataGridComboBoxColumn) --> EditingElementStyle(EditingElementStyle) --> Setters(1) (get first setter from style) --> Value (Setter Value) --> Path (PropertyPath) --> Path (Actual PropertyName)
If you want to get ItemsSource
property name, replace Setters[1]
with Setters[0]
.