Check / Uncheck functionality in Menu.

2 posts, 0 answers
  1. Dheeraj Khajuria
    Dheeraj Khajuria avatar
    7 posts
    Member since:
    Jul 2009

    Posted 23 Oct 2009 Link to this post

    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.
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 26 Oct 2009 Link to this post

    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.
Back to Top