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

Accessing ContentTemplate from code

1 Answer 16 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Fit2Page
Top achievements
Rank 1
Iron
Veteran
Iron
Fit2Page asked on 30 Mar 2015, 07:39 AM
This works for ItemTemplate:

http://www.telerik.com/help/aspnet-ajax/menu-templates-accessing-controls.html

But how can I access the ContentTemplate for a menu item from code?

Marc

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 01 Apr 2015, 01:12 PM
Hello,

The controls placed in a RadMenuItem ContentTemplate can be accessed by their ID, as shown below:
<telerik:RadMenu ID="RadMenu1" runat="server" Width="450">
    <Items>
         <telerik:RadMenuItem Text="Root1">
            <ContentTemplate>
                <telerik:RadButton runat="server" ID="Button1"></telerik:RadButton>
            </ContentTemplate>
        </telerik:RadMenuItem>
    </Items>
</telerik:RadMenu>

protected void Page_Load(object sender, EventArgs e)
{
    Button1.Text = "NewText";
}

Regards,
Ivan Danchev
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
Menu
Asked by
Fit2Page
Top achievements
Rank 1
Iron
Veteran
Iron
Answers by
Ivan Danchev
Telerik team
Share this question
or