fire itemclick event

2 posts, 0 answers
  1. Sigma
    Sigma avatar
    87 posts
    Member since:
    Apr 2012

    Posted 10 Dec 2012 Link to this post

    How can i fire itemclick event when the navigateurl property of menuitem is set
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 10 Dec 2012 Link to this post

    Hi Sigma,

    One of the possible solutions is to subscribe to the ItemDataBound / ItemCreated event and set the NavigateUrl property to an empty string as follows.

    <telerik:RadMenuItem runat="server" Text="This item will not fire ItemClick event"  NavigateUrl="myPage.aspx">               

    protected void RadMenu1_ItemDataBound(object sender, RadMenuEventArgs e)     
        e.Item.Attributes["NavigateUrl"] = e.Item.NavigateUrl;         
        e.Item.NavigateUrl = "";     
    protected void RadMenu1_ItemClick(object sender, RadMenuEventArgs e)
        //Custom code here                    

    Please take a look into this documentation for more information.

    Hope this helps.

Back to Top