We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to enable Custom Context Menu in GridDataControl

Platform: WPF |
Control: GridDataControl |
Published Date: August 6, 2014 |
Last Revised Date: August 6, 2014 |
.NET Framework: 4 |
Product Version: 12.1.0.43

ContextMenu displays a list of menu items added to it and performs the specified action when you click on the menu items. In GridDataControl, you can enable the ContextMenu by setting EnableContextMenu property as ‘True’. The ContextMenu for Headers, Records and GroupCaption area are enabled with default MenuItems. You can customize these context menu items using theContextMenuOptions” property.

ContextMenuOptions

GridDataControl contain the following ContextMenu options.

Default

Using Default options we can enable the default context menu items only.

Custom

Using Custom context menu options we can create the context menu items based on our requirement.

CustomWithDefault

Using CustomWithDefault option we can add context menu items to the default context menu items.

 

ContextMenuItems

You can customize the HeaderContextMenuItems, GroupHeaderContextMenuItems and RecordContextMenuItems by adding the new menu items to the collection.

For example, you can create menu items for records like “Add”, ”Remove”,” Update” as shown in the following code sample.

XAML

 

C#

 

The following screenshot illustrates the output for customizing the ContextMenu based on cell value using the QueryContextMenuInfo event in GridDataControl.

 

D:\Syncfusion\Issues\2014 Volume 2\KB Issues\KB Images\Customization based on cell value.png

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon