This is a migrated thread and some comments may be shown as answers.

Child menu items not displaying underneath main menu items.

1 Answer 34 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Brad
Top achievements
Rank 1
Brad asked on 22 Sep 2008, 03:19 AM
Hi,
I'm binding a RadMenu directly to an ArrayList (not through an ObjectDataSource), but the child items are displaying to the right, and not underneath as one would expect. I've copied the example code from http://www.telerik.com/help/aspnet-ajax/menu_dataobjectdatasources.html using the 'Binding to an ArrayList' example word-for-word and can't seem to figure out why? I've tested in IE 7 & FF3.

My design code:
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <div>
       
        <telerik:RadMenu ID="RadMenu1" Flow="Horizontal" runat="server">
        </telerik:RadMenu>
       
    </div>
    </form>
</body>

and code behind:
    public partial class _Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                RadMenu1.DataTextField = "Text";
                RadMenu1.DataNavigateUrlField = "Url";
                RadMenu1.DataFieldID = "ID";
                RadMenu1.DataFieldParentID = "ParentID";
                RadMenu1.DataSource = GenerateSiteData();
                RadMenu1.DataBind();

                
            }
        }
        private ArrayList GenerateSiteData()
        {
            ArrayList siteData = new ArrayList();
            siteData.Add(new SiteDataItem(1, null, "All Sites", ""));
            siteData.Add(new SiteDataItem(2, 1, "Search Engines", ""));
            siteData.Add(new SiteDataItem(3, 1, "News Sites", ""));
            siteData.Add(new SiteDataItem(4, 2, "Yahoo", "http://www.yahoo.com"));
            siteData.Add(new SiteDataItem(5, 2, "MSN", "http://www.msn.com"));
            siteData.Add(new SiteDataItem(6, 2, "Google", "http://www.google.com"));
            siteData.Add(new SiteDataItem(7, 3, "CNN", "http://www.cnn.com"));
            siteData.Add(new SiteDataItem(8, 3, "BBC", "http://www.bbc.co.uk"));
            siteData.Add(new SiteDataItem(9, 3, "FOX", "http://www.foxnews.com"));
            return siteData;
        }

    }

    public class SiteDataItem
    {
        private string _text;
        private string _url;
        private int _id;
        private int? _parentId;
        public string Text
        {
            get { return _text; }
            set { _text = value; }
        }
        public string Url
        {
            get { return _url; }
            set { _url = value; }
        }
        public int ID
        {
            get { return _id; }
            set { _id = value; }
        }
        public int? ParentID
        {
            get { return _parentId; }
            set { _parentId = value; }
        }
        public SiteDataItem(int id, int? parentId, string text, string url)
        {
            _id = id;
            _parentId = parentId;
            _text = text;
            _url = url;
        }
    }

I'm using the 'RadControls 'Prometheus' for ASPNET Q3 2007'
Thanks.

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 22 Sep 2008, 07:20 AM
Hi Brad,

Please make sure you are using the current official release of RadMenu (assembly version should be 2008.02.826).

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Menu
Asked by
Brad
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or