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

Dynamically update a label inside a RadMenuItem

2 Answers 184 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Evelyne Schreiner
Top achievements
Rank 1
Evelyne Schreiner asked on 24 Jun 2010, 07:49 AM
Hi,

I'm setting a menu using the "mega drop-down" sample. The menu and sitemap are working fine but I'd like to dynamically update a part of the menu items.

I'm binding some content from the siteMap on the left of the menuItem and, on the right, I want to dynamicall add some text:
 
                <telerik:RadMenuItem Text="Home" PostBack="false" CssClass="menuOff" ClickedCssClass="menuOn"  SelectedCssClass="menuOn" FocusedCssClass="menuOn" ExpandedCssClass="menuOn">  
                    <Items> 
                        <telerik:RadMenuItem CssClass="">  
                                <ItemTemplate> 
                                <div class="menuContent">  
                                        <div class="menuLeftPart">  
                                        <div id="menuSiteMap">  
                                             <telerik:RadSiteMap runat="server" ID="RadSiteMapHome" Skin=""  DataSourceID="RadSiteMapData0" Width="640px" CssClass="leSiteMap" EnableTheming="false">  
                                                <DefaultLevelSettings> 
                                                    <NodeTemplate> 
                                                        <class="siteMapLink" href='<%# DataBinder.Eval(Container.DataItem, "url") %>'>  
                                                            <%# DataBinder.Eval(Container.DataItem, "title") %> 
                                                        </a>            
                                                    </NodeTemplate> 
                                                </DefaultLevelSettings>    
                                            </telerik:RadSiteMap> 
                                        </div> 
                                    </div> 
                                    <div class="menuRightPart">[Insert HTML code here dynamically]</div>                                     
                                </div> 
                            </ItemTemplate> 
                        </telerik:RadMenuItem> 
                    </Items> 
                </telerik:RadMenuItem> 
I've tried using a "Label" but cannot access it from my code-behind (vb.net). Is it protected because it is inside the RadMenuItem ?

Thank you for your help.

2 Answers, 1 is accepted

Sort by
0
Accepted
Yana
Telerik team
answered on 24 Jun 2010, 10:21 AM
Hi Evelyne,

Please check this help article which explains how to access the nested inside item template controls.

Best regards,
Yana
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
0
Evelyne Schreiner
Top achievements
Rank 1
answered on 24 Jun 2010, 11:07 AM
That's exactly what I needed. Thank you for the fast answer, Yana.
Tags
Menu
Asked by
Evelyne Schreiner
Top achievements
Rank 1
Answers by
Yana
Telerik team
Evelyne Schreiner
Top achievements
Rank 1
Share this question
or