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 custom click - args

Thread ID:





118346 Feb 27,2015 05:14 PM UTC Mar 2,2015 10:53 AM UTC ASP.NET MVC 1
Tags: TreeGrid
Neil Partington
Asked On February 27, 2015 05:14 PM UTC

I have a custom menu on the TreeGrid control, setup as per your examples seen below.

The function that handles the menu click has "args" as a parameter. Can you tell me what type of object this is and how i can extract the selected rows information from it?

Do you have any reference documents at all for your controls, since your documentation is very basic?


<script type=”text/javascript”>

  function customMenu( args )




      headerText: "customMenu",

   iconPath: “url(…/images/custommenu.png)”,

   eventHandler: customMenuClick,




  function customMenuClick( args )




John Rajaram [Syncfusion]
Replied On March 2, 2015 10:53 AM UTC

Hi Neil,

Thanks for using Syncfusion products.

Query 1:

Can you tell me what type of object this is and how i can extract the selected rows information from it?


We would like to let you know that, “args” parameter, which is passed to the “ContextMenuOpen” client side event is a JSON object. It holds the details of the selected rows, list of context menu items and their corresponding sub context menu items. Please check the following details for the list of items available in the “args” parameter.




List of context menu items


Index of the selected row


List of sub context menu items corresponding to the main context menu items.


Details of the selected rows


TreeGrid object


Html elements of the clicked row

Please find the below code snippets for rendering custom context menu in TreeGrid.

Code snippets:

<body style="position: static; margin: 0px; padding: 2px">



    .ContextMenuSettings(cms => cms.ShowContextMenu(true)

        .ContextMenuItems(new List<TreeGridContextMenuItems>()











       function customMenu(args) {


               headerText: "Menu_1",

               iconPath: 'url("../../Images/setIcon.png")',

               eventHandler: customMenuClick1,



               headerText: "Menu_2",

               iconPath: 'url("../../Images/setIcon.png")',

               eventHandler: customMenuClick2,



       function customMenuClick1(args) {

           alert("Custom Menu 1 clicked");


       function customMenuClick2(args) {

           alert("Custom Menu 2 clicked");




We have also prepared a sample based on this for rendering the context menu. Please find the sample in the following location.

Sample: http://www.syncfusion.com/downloads/support/directtrac/118346/TreeGridMVC_simple_custom__context_menu1065681504.zip

Query 2:

Do you have any reference documents at all for your controls, since your documentation is very basic?


We request you to refer the below online link for the reference documents related to the properties of all Syncfusion controls.

Online Link: http://help.syncfusion.com/cr/js

For TreeGrid control, we have logged a documentation improvement task for this. Also we have created a support incident under your account to track the status of the documentation task and documentation information from all other Syncfusion controls.

Please log on to our support website to check for further updates.


Please let us know if you require further assistance on this.

John. R


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

or the page will be automatically redirected to 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