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

Context Menu issue after loading from database

Thread ID:





132543 Sep 7,2017 02:49 PM UTC Sep 11,2017 04:16 AM UTC ASP.NET MVC 3
Tags: Diagram
Aravind Ashokkumar
Asked On September 7, 2017 02:49 PM UTC

Hi ,

After setting the various context menu parameters on the server side, I am getting an error.

"Cannot read property 'test' of undefined"

Server side code for adding context menu items is :

                    DiagramProperties model = new DiagramProperties();
                    List<ContextMenuItem> LabelSubItems = new List<ContextMenuItem>();
                    LabelSubItems.Add(new ContextMenuItem() { Name = "alignLabel", Text = "Align Label" });
                    LabelSubItems.Add(new ContextMenuItem() { Name = "updateRowLabel", Text = "Row Label", });
                    model.ContextMenu = new DiagramContextMenu();
                    model.ContextMenu.Items.Add(new ContextMenuItem() { Name = "test", Text = "Label Test" });
                    model.ContextMenu.Items.Add(new ContextMenuItem() { Name = "label", Text = "Label Update", SubItems = LabelSubItems });

                    model.ContextMenuBeforeOpen = "contextMenuBeforeOpen";
                    model.ContextMenuClick = "contextMenuClick";

Could you please let me know what might be the issue?


Shyam G [Syncfusion]
Replied On September 8, 2017 04:46 PM UTC

Hi Aravind, 
We have applied your code example in our sample and we are unable to reproduce the reported issue at our end. Could you please provide us more details such as modify the below sample or share your sample or video to demonstrate the exact use case of the issue. 
Shyam G 

Aravind Ashokkumar
Replied On September 9, 2017 05:07 PM UTC

Hi Shyam,

I had corrected the issue after adding the following line to the c#html page. 




Shyam G [Syncfusion]
Replied On September 11, 2017 04:16 AM UTC

Hi Aravind, 
We are happy to hear that your problem is resolved. Please let us know if you need further assistance on this. 
Shyam G 


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.

Please sign in to access our forum

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

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