I have xamdatagrid and contextmenu
igDP:XamDataGrid.ContextMenu > <ContextMenu DataContext="{Binding RelativeSource={RelativeSource Mode=Self}, Path=PlacementTarget.DataContext}" AllowDrop="True" Name="cmAudit"> <MenuItem Header="a" />
<MenuItem Header="a" /> ..so on
</ContextMenu>
</igDP:XamDataGrid.ContextMenu >
When i rightclikc this contextmenu is displayed ..but i dont want to display when the user clicks on column header.
how to restrict it .
HI,
Are you getting any binding errors in the output window?
Can you attach a small isolated sample to this thread?
Hi, I have a similar issue where i am using my wrapped XamDataGrid in a user control(QueueTable) which is further used in another control(QueueUI View).
I added a context menu in my RunQueueTable.xaml like this:
<datagrid:DataGrid.ContextMenu> <ContextMenu> <MenuItem Header="Delete" Command="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:QueueUIView}}, Path=DeleteCommand}"/> </ContextMenu> </datagrid:DataGrid.ContextMenu>
I want to attach the context menu with the command which i have declared in the datacontext of QueueUIView that is the view model.
QueueUIView .xaml looks like this:-
<exCtrl:CompositeNavigationPane.ViewingPane> <local:QueueTable DataContext="{Binding QueueManager.RunQueue, Mode=OneWay}" /> </exCtrl:CompositeNavigationPane.ViewingPane>
My Delete command does not get executed. Please help.
Please let me know if you need further assistance regarding this post.
Sincerely, Matt Developer Support Engineer
HI ,
I am attaching a sample XamDataGrid application that has a contextmenu and a a menuitem with a command bound to a staticresource.
Your commands can not be found, because the contextmenu is in its own visual tree.
To see the ContextMenu right click over the Ischecked field.
Please review my sample application.
Sincerley,
Matt Developer Support Engineer
Iam using XamContext Menu .
<igDP:XamDataGrid.ContextMenu > <ContextMenu DataContext="{Binding RelativeSource={RelativeSource Mode=Self}, Path=PlacementTarget.DataContext}" AllowDrop="True" Name="cmAudit"> <MenuItem Header="a" Command="{Binding ContextMenuClickedCommand}" CommandParameter="a" /> <MenuItem Header="b" Command="{Binding ContextMenuClickedCommand}" CommandParameter="b" /> <MenuItem Header="c" Command="{Binding ContextMenuClickedCommand}" CommandParameter="c" /> <MenuItem Header="d" Command="{Binding ContextMenuClickedCommand}" CommandParameter="d" /> <MenuItem Header="e" Command="{Binding ontextMenuClickedCommand}" CommandParameter="e" />
</igDP:XamDataGrid.ContextMenu>
As u said in 1st approach i moved contextmenu to <igDP:XamDataGrid.Resources> ...Now menu is not coming on column header but when i rightclick and select a ..then it is not hitting the execute method do I Need to make any more changes
<igDP:XamDataGrid.Resources> ...
Now menu is not coming on column header but when i rightclick and select a ..then it is not hitting the execute method
do I Need to make any more changes