This is a migrated thread and some comments may be shown as answers.

set Autopostback to false

1 Answer 132 Views
Menu
This is a migrated thread and some comments may be shown as answers.
L
Top achievements
Rank 1
L asked on 05 Feb 2012, 05:47 AM
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

1 Answer, 1 is accepted

Sort by
0
Accepted
Kate
Telerik team
answered on 08 Feb 2012, 04:46 PM
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 >>
Tags
Menu
Asked by
L
Top achievements
Rank 1
Answers by
Kate
Telerik team
Share this question
or