Hi,
i need some help on implementing support for HeaderContextMenu using Prism and MVVM.
The code snippet on your help doesn't seem to work.
I want to have 2 sort of context menu. 1 for the Header and the other one the selected items in the grid.
This one is working fine:
<syncfusion:SfDataGrid.ContextMenu>
<ContextMenu>
<MenuItem Header="Search on Google"
Command="{Binding ContextMenuGoogleSearchCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=ContextMenu}, Path=PlacementTarget.SelectedItems}" >
</MenuItem>
</ContextMenu>
</syncfusion:SfDataGrid.ContextMenu>
And i have this for the Header:
<syncfusion:SfDataGrid.HeaderContextMenu>
<ContextMenu>
<MenuItem Command="{Binding ContextMenuClearFilterCommand}"
CommandParameter="{Binding}"
Header="Clear Filter">
</MenuItem>
</ContextMenu>
</syncfusion:SfDataGrid.HeaderContextMenu>
While the first calls my command in my ViewModel, the context menu for the Header is shown, but the command is not invoked.
i have seen your sample, where you use the interactivity behavior to contruct the menu, but this would execute then outside my viewmodel.
any idea how i can make this work with my viewmodel?
thanks,
Helmut