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. Image for the cookie policy date

Only custom items in ContextMenu

Hello,

I have this code:

Grid.ContextMenuSettings = new Syncfusion.JavaScript.Models.ContextSettings();
Grid.ContextMenuSettings.EnableContextMenu = true;
Grid.ContextMenuSettings.ContextMenuItems = new List<string>();
Grid.ContextMenuSettings.CustomContextMenuItem.Add('Custom item');

But the ContextMenu shows the default items and custom items, and I want only the custom items, how to do this?

Thanks!

1 Reply

SA Saravanan Arunachalam Syncfusion Team December 18, 2015 10:38 AM UTC

Hi Jorge,

Thanks for contacting Syncfusion support.

If you need to show only the custom menu items, we suggest you to add empty string in the contextMenuItem List of Grid control. Please refer to the below code example and online documentation link.


        protected void Page_Load(object sender, EventArgs e)

        {

             . . .

            Grid.ContextMenuSettings.ContextMenuItems = new List<string>();

            //Add empty string in the ContextMenuItems List to show only custom items

            Grid.ContextMenuSettings.ContextMenuItems.Add("");

            . . .

           

         }



http://help.syncfusion.com/js/grid/contextmenu#custom-context-menu

Regards,

Saravanan A.


Loader.
Up arrow icon