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

Nested ContextMenuItems

I'm using custom context menu and nested MenuItems.

new()

{

Text = "Change Order",

Target = ".e-content",

Id = "ChangeOrder",

IconCss = "fas fa-link",

Items = new List()

{

new()

{

Text = "Add",

Id = "ChangeOrderAdd",

IconCss = "fas fa-plus"

},

new()

{

Text = "View",

Id = "ChangeOrderView",

IconCss = "fas fa-align-justify"

}

}

}


protected async Task OnContextMenuClickHandler(ContextMenuClickEventArgs args)

{

if (args.Item.Id == "ChangeOrder") return;

}

The issue is that I need to be able to disable ContextMenuItemClicked event for the top level ContextMenuItemModel. It is triggering ContextMenuItemClicked event when it should not and if I put in a guard to exit the ContextMenuItemClicked event the context menu gets closed.


** Please refer to attached video.


Attachment: 20230118_141820_5e13b20f.zip


3 Replies

NP Naveen Palanivel Syncfusion Team January 25, 2023 03:26 AM UTC

Hi Dainel,


Thank you for reaching out to Syncfusion support,


We have checked your query and before proceeding further with your requirement kindly share the below details to validate further at our end.


  1. Share us the entire Grid code snippet along with model class.
  2. Share more details about your requirement elaborately
  3. Please share does you have defined code to disable the context menu click event
  4. Share us the video demonstration of the issue with elaborately , it will more useful to us.
  5. If possible share us an simple issue reproduceable sample


The above-requested details will be very helpful for us to validate the reported query at our end and provide the solution as early as possible.


Regards,

Naveen Palanivel



SI Sim February 1, 2023 08:43 AM UTC

To optimize my game webpage, I used the ShowOnClick property of the ContextMenuItemModel.

This allowed me to continue to use the web page and pick at online slots without any problems and improving the overall performance of the games.

I was able to do this by setting the IsSelectable property of the top-level ContextMenuItemModel to false. This prevented the ContextMenuItemClicked event from being fired when the top-level ContextMenuItemModel was clicked, as the IsSelectable property determines whether or not the item can be selected. Additionally, I set the IsEnabled property of the top-level ContextMenuItemModel to false, which prevented the user from interacting with the item. This ensured that the ContextMenuItemClicked event would not be fired when the top-level ContextMenuItemModel was clicked.



NP Naveen Palanivel Syncfusion Team February 9, 2023 11:30 PM UTC

Hi Sim,


We have checked your query and before proceeding further with your requirement kindly share the below details to validate further at our end.


  1. if the issue faced in the grid , share us the entire Grid code snippet along with model class.
  2. Share more details about your requirement with grid contextmenuItemModel elaborately
  3. Share us the video demonstration of the issue with elaborately , it will more useful to us.
  4. If possible share us an simple issue reproduceable sample


The above-requested details will be very helpful for us to validate the reported query at our end and provide the solution as early as possible.


Regards,

Naveen Palanivel


Loader.
Live Chat Icon For mobile
Up arrow icon