Get IsSeparator with Sql Database

2 posts, 0 answers
  1. Jessy Joseph
    Jessy Joseph avatar
    34 posts
    Member since:
    Mar 2010

    Posted 27 May 2010 Link to this post


    In my project I am getting the menu items programaticaly from the sql server. The problem I am facing is, how to add IsSeperator  in the database and call in the code?

    aspx file


    <telerik:RadMenu ID="radMenu" runat="server" EnableRoundedCorners="true" EnableShadows="true"



    Skin="Office2007" >





    cs file



    void buildMenu()




    OleDbConnection dbCon = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("~/MenusiteMap.mdb"));




    OleDbDataAdapter adapter = new OleDbDataAdapter("SELECT * FROM Sitemap_Menu ORDER BY MenuId", dbCon);



    DataSet ds = new DataSet();




    "NodeRelation", ds.Tables[0].Columns["MenuId"], ds.Tables[0].Columns["ParentId"]);



    foreach (DataRow dbRow in ds.Tables[0].Rows)




    if (dbRow.IsNull("ParentId"))




    RadMenuItem newItem = CreateItem(dbRow);



    PopulateSubMenu(dbRow, newItem);






    private RadMenuItem CreateItem(DataRow dbRow)




    RadMenuItem item = new RadMenuItem();


    item.Text = dbRow[



    item.NavigateUrl = dbRow[



    item.ImageUrl = dbRow[



    item.HoveredImageUrl = dbRow[




    return item;




    private void PopulateSubMenu(DataRow dbRow, RadMenuItem item)




    foreach (DataRow childRow in dbRow.GetChildRows("NodeRelation"))




    RadMenuItem childItem = CreateItem(childRow);



    PopulateSubMenu(childRow, childItem);


    database fields
    MenuID, Text, ParentID,Navigateurl,IconImage,HoverIconImage

  2. Peter
    Peter avatar
    6637 posts

    Posted 01 Jun 2010 Link to this post

    Hello Jessy,

    Please, see this help topic on databinding RadMenu. More specifically, scroll down to
    3.Create an ItemDataBound event handler to set additional properties on the menu items:

    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top