set Autopostback to false

2 posts, 1 answers
  1. L
    L avatar
    295 posts
    Member since:
    Apr 2008

    Posted 04 Feb 2012 Link to this post

    hi

    My menu is bound to a sqldatasource and i would to disable the autopostback on the parent item.

    I know the parent item autopostback can be disable when you build your menu manually but how do i do so when my menu is data bound to a sqldatasource? Thanks
  2. Answer
    Kate
    Admin
    Kate avatar
    1898 posts

    Posted 08 Feb 2012 Link to this post

    Hi L,

    You can subscribe on the OnClientItemClicking event , check if the clicked item is rootitem and if so cancel the postback of the page:
     
    <script type="text/javascript">
    function onClicking(sender, eventArgs)
    {
      var item = eventArgs.get_item();
        
      if (item.get_level() == 0)
      {
          eventArgs.set_cancel(true);
      }
    }
    </script>
    <telerik:RadMenu ID="RadMenu1" runat="server"
       OnClientItemClicking="onClicking">

    Greetings,
    Kate
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top