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

RadMenuItem Client Problems

1 Answer 51 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Adam
Top achievements
Rank 1
Adam asked on 09 Nov 2009, 03:44 PM
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?

1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 13 Nov 2009, 05:28 PM
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.
Tags
Menu
Asked by
Adam
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or