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
close icon

to disable click event for parent items in menu object

Hi,

I am trying the menu object with MenuItemBinding.I like binding ID and Parent ID fields for hierarchical data.

But is it possible to disable all events for parent items when using menu DataBindings.

what i want is, just the ultimate nodes should be clickable and the link cursor should appear just these ultimate nodes.

I am attaching the representative sample image.



trial_syncfusion_menu_bb318e9e.zip

1 Reply

RP Rekha P Syncfusion Team January 24, 2009 07:12 AM UTC

Hi Sinan,

Thank you for your interest in Syncfusion Products.

Yes, the disable of NavigateUrl for Menu parent items is possible by enabling NavigateUrl for parent items as null in ItemSelect event. Please refer the code snippet below to achieve this.

bool Menu1_ItemSelect(object oSender, Syncfusion.Web.UI.WebControls.Tools.MenuCommandEventArgs e)
{
if (e.Item.HasSubNodes) //Parent Item
{
e.Item.NavigateUrl = "";
}
return true;
}


Also please refer the sample below which illustrates the NavigateUrl to only child items in Menu.

http://websamples.syncfusion.com/samples/Tools.Web/7.1.0.21/F79127_Menu/main.htm

We appreciate your patience and please let me know if this helps you.

Thanks,
Rekha


Loader.
Live Chat Icon For mobile
Up arrow icon