Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
495
WebDataMenu Primer
posted

I am new to the Infragistics Net Advantage for ASP.NET product and am trying to convert a web site from 2008.3 to 2011.2.  Our site currently uses uses the UltraWebMenu control to build menus dynamically from database queries and we need to convert to the WebDataMenu control to make the site compatible with the IE9 browser.  Since the Infragistics web site is woefully inadequate for finding info on building menus  and setting their appearance dynamically, I need some help.  Does anyone know of a site that provides a good pimer on the WebDataMenu control and especially building menus dynamically?

Thanks,

Roger

Parents
  • 3115
    Suggested Answer
    Offline posted

    Hi Roger,

    Here is a simple example how to bind webdataMenu on SQL Data source.

    In aspx.

     

     

     

     

     

     

     

     

     

     

     

     

    <ig:WebScriptManager ID="WebScriptManager1" runat

    ="server">

    </

     

     

     

    ig:WebScriptManager

    >

    <

     

     

     

    ig:WebDataMenu ID="WebDataMenu1" runat="server" DataMember="Categories" MaxDataBindDepth

    ="1">

     

     

     

    <DataBindings

    >

     

     

     

    <ig:DataMenuItemBinding ValueField="CategoryName" TextField

    ="CategoryName"/>

     

     

     

    </DataBindings

    >

    </

     

     

     

    ig:WebDataMenu

    >

    <

     

     

     

    asp:SqlDataSource ID="SqlDataSource1" runat="server"

     

     

     

    ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"

     

     

     

    SelectCommand="SELECT [CategoryName] FROM [Categories]"></asp:SqlDataSource

    >

    In C#:

     

     

    protected void Page_Load(object sender, EventArgs e)

    {

     

     

    if (!IsPostBack)

    {

     

     

    this.WebDataMenu1.DataSource = this.SqlDataSource1;

     

     

    this.WebDataMenu1.DataBind();

    }

    }

    In the example I use SQL data source I use the wizard to create the connection string and the select command. it takes all the categoryNames from the Categories table from the Northwind DB. After that these items are bound to the menu items of the WebDataMenu

    I hope that will help you

    Thanks,

Reply Children