New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

Data Bindings

  • File
    • New
    • Open
    • Save
    • Save As
    • Print Preview
    • Print
    • Close
  • Edit
    • Undo
    • Cut
    • Copy
    • Paste
    • Clipboard...
  • Insert
    • Break...
    • Page Numbers...
    • Date and Time...
    • Field...
    • Symbol...
    • Comment
    • Picture
    • Diagram
    • Hyperlink

The DataBindings collection lets you provide different sets of data bindings to the items on different levels of the menu. You can even bind the menu items on each level of the menu from different tables in a DataSet.

This example demonstrates how to use databindings to apply declarative mapping of data fields to menu item properties.

<telerik:RadMenu runat="server" ID="RadMenu1" DataSourceID="XmlDataSource1" DataFieldID="id"
		<telerik:RadMenuItemBinding TextField="Text" />
		<telerik:RadMenuItemBinding Depth="1" ImageUrlField="ImageUrl" TextField="Text" />
<asp:XmlDataSource runat="server" ID="XmlDataSource1" DataFile="Menu.xml" XPath="/Menu/MenuItem" />
  • DefaultCS.aspx
  • styles.css
  • Menu.xml
<%@ Page  %>

<!DOCTYPE html>
<html xmlns=''>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <link href="styles.css" rel="stylesheet" />

    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />

    <div class="demo-container size-thin">
        <telerik:RadMenu RenderMode="Lightweight" runat="server" ID="RadMenu1" DataSourceID="XmlDataSource1" DataFieldID="id"
            DataFieldParentID="parentID" EnableRoundedCorners="true" EnableShadows="true">
                <telerik:RadMenuItemBinding Depth="0" TextField="Text" CssClass="rootItems" />
                <telerik:RadMenuItemBinding Depth="1" ImageUrlField="ImageUrl" TextField="Text" />

    <asp:XmlDataSource runat="server" ID="XmlDataSource1" DataFile="Menu.xml" XPath="/Menu/MenuItem"></asp:XmlDataSource>


Support & Learning Resources

Find Assistance