This is a migrated thread and some comments may be shown as answers.
Check / Uncheck functionality in Menu.
1 Answer 33 Views
This is a migrated thread and some comments may be shown as answers.
Dheeraj Khajuria
Top achievements
Rank 1
Dheeraj Khajuria asked on 23 Oct 2009, 12:15 PM
Can we have check boxes in menu and controll the check/uncheck actions in Java script? Actually we dont want to have post back for having check/uncheck functionality.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 26 Oct 2009, 08:21 AM
Hello Dheeraj,

You can add checkboxes in the ItemTemplate of the RadMenu. Here's an example:
aspx:
 <telerik:RadMenu DataSourceID="SqlDataSource1" Flow="Vertical"  ID="RadMenu1" runat="server"
     <ItemTemplate>                
         <asp:CheckBox ID="checkbox1" runat="server"  onclick="checkboxclicked(this);" /> 
         <%#Eval("FirstName")%> 
     </ItemTemplate> 
 </telerik:RadMenu> 

js:
 function checkboxclicked(checkbox) 
    { 
       var text = checkbox.nextSibling.nodeValue; 
       if(checkbox.checked) 
       {          
         alert("Selected text is" + text); 
       } 
       else  
       { 
         alert("Unselected text is" + text); 
       } 
        
    } 

Thanks
Shinu.
Tags
Menu
Asked by
Dheeraj Khajuria
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Share this question
or