I have the following XAML:
I believe it should be this
<dxg:GridControl Name="theGrid" DataSource="{Binding Path=Groupings}">
<dxg:GridControl.ContextMenu>
<ContextMenu>
<MenuItem x:Name="gridprint"
Command="{Binding Path=GridPrintCommand}"
CommandParameter="{Binding ElementName=theGrid}"
/>
</ContextMenu>
</dxg:GridControl.ContextMenu>
Try using this:
<MenuItem x:Name="gridprint"
CommandParameter="{Binding PlacementTarget, RelativeSource=
{RelativeSource FindAncestor, AncestorType={x:Type ContextMenu}}}" />
ContextMenus are not part of the WPF's normal VisualTree, so you have to bind using the PlacementTarget to get the object the ContextMenu is attached to