RadMenu for ASP.NET

Enumerate the menu items Send comments on this topic.
See Also
Telerik RadMenu client-side > Enumerate the menu items

Glossary Item Box

You can enumerate all items in the menu instance using the EnumerateAllItems() method. To enumerate only root items, use the Items collection of the menu, or the Items collection of the respective parent item.

Examples:

Enumerate root items Copy Code
<script type="text/javascript">

   
function EnumerateRootItems()
       {
       
var menu = <%= RadMenu1.ClientID %>;
       
for (var i=0; i<menu.Items.length; i++)
           {
              
alert(menu.Items[i].Text);
           }
       }
</script>
        
Enumerate all items Copy Code
<script type="text/javascript">

   
function EnumerateAllItems()
      {
       
var menu = <%= RadMenu1.ClientID %>;
       
for (var i=0; i<menu.AllItems.length; i++)
           {
              
alert(menu.AllItems[i].Text);
           }
      }
</script>
        

See Also