RadMenuItem Client Problems

2 posts, 0 answers
  1. Adam
    Adam avatar
    5 posts
    Member since:
    Apr 2008

    Posted 09 Nov 2009 Link to this post

    I may be missing something very obvious, but is there any reason why the RadMenuItem objects don't render an ID attribute? To circumvent this problem, I've created a custom RadMenuItem object that renders an ID, but shouldn't this be the standard or atleast an option to turn on/off on the RadMenu control?
  2. T. Tsonev
    Admin
    T. Tsonev avatar
    2815 posts

    Posted 13 Nov 2009 Link to this post

    Hello Adam,

    The ID is not rendered in order to save space. With multiple naming containers the client IDs can become rather big.

    You can still force the rendering of the IDs if you need them:

    protected override void OnPreRender(EventArgs e)
    {
        base.OnPreRender(e);
     
        foreach (RadMenuItem menuItem in RadMenu1.GetAllItems())
        {
            menuItem.Attributes["ID"] = menuItem.ClientID;
        }
    }

    I hope this helps.

    Sincerely yours,
    Tsvetomir Tsonev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top