Reputation: 155
I have a DevExpress grid control and I want to disable the default context menu that appears when I right click the Grid column headers. To disable this functionality I handled the PreviewMouseRightButtonDown
and PreviewMouseRightButtonUp
private void UserControl_PreviewMouseRightButtonDown_Up(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
e.Handled = true;
}
This is not an acceptable solution. There should be should be something on grid control.
Upvotes: 1
Views: 4052
Reputation: 5708
If you want disable specific context menu item you can manage it by binding
<dxb:BarButtonItem Name="contexMenuTransmitPendingClaim"
Command="{Binding Path=(dxb:GridPopupMenuBase.GridMenuInfo).View.DataContext.TransmitPendingClaimCommand,
RelativeSource={RelativeSource Self}}"
Content="Transmit Pending Claim"
IsEnabled="{Binding Path=(dxb:GridPopupMenuBase.GridMenuInfo).View.DataContext.SelectedCusHisViewRefillHistory.IsPendingClaimsActive,
RelativeSource={RelativeSource Self},
Mode=TwoWay,
UpdateSourceTrigger=PropertyChanged}"/>
Upvotes: 0
Reputation: 17848
Please set the TableView.IsColumnMenuEnabled property to control whether the column context menu is shown when an end-user right-clicks a column's header.
You can read more about all avilable DXGrid's context menus and its customization here: Context Menus
Upvotes: 3