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.
Unfortunately, activation email could not send to your email. Please try again.

Add custom context menu to grid control

Thread ID:





125511 Aug 22,2016 02:24 AM Aug 23,2016 07:24 AM ASP.NET MVC 1
Tags: Grid
Mahindra Morar
Asked On August 22, 2016 02:24 AM

I am trying to add a custom context menu to a Grid control as follows:


             .ContextMenuSettings(contextMenu =>
                 contextMenu.EnableContextMenu().CustomContextMenuItems(new List<string>() { "MyMenuItem" });            
            .ClientSideEvents(eve => { eve.ContextClick("contextclick").RightClick("rightclick").ContextOpen("contextopen"); })            
              .Columns(col =>
                  col.Field("BookingCode").HeaderText("Booking Code").Add();               
                  col.Field("CustomerReference").HeaderText("Customer Reference").Add();

but get the following compilation error:

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1660: Cannot convert lambda expression to type 'Syncfusion.JavaScript.Models.ContextSettings' because it is not a delegate type

Source Error:

Line 88:               .AllowPaging()
Line 89: 
Line 90:              .ContextMenuSettings(contextMenu =>
Line 91:              {
Line 92:                  contextMenu.EnableContextMenu().CustomContextMenuItems(new List<string>() { "MyMenuItem" });   

Any help to resolve this issue would be much appreciated.

Prasanna Kumar Viswanathan [Syncfusion]
Replied On August 23, 2016 07:24 AM

Hi Mahindra, 

Thanks for contacting Syncfusion support. 

We have modified the customContextMenuItems property to accept the values as the list of objects instead of list of strings. We also informed about this changes in Release notes of Please refer to code example, sample and release notes for more information 
Code example: 

          .ContextMenuSettings(contextMenu => 
                    .CustomContextMenuItems(new List<CustomContexMenuItems>() { new CustomContexMenuItems() { Id = "MyMenu", Text = "MyMenuItem" } }); // CustomContext menu items 
         .ClientSideEvents(eve => { eve.ContextClick("contextclick"); }) 
         .Columns(col => 

Prasanna Kumar N.S.V 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

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.