Dynamically update a label inside a RadMenuItem

3 posts, 1 answers
  1. Evelyne Schreiner
    Evelyne Schreiner avatar
    20 posts
    Member since:
    Sep 2009

    Posted 24 Jun 2010 Link to this post

    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. Answer
    Yana
    Admin
    Yana avatar
    5044 posts

    Posted 24 Jun 2010 Link to this post

    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
  3. Evelyne Schreiner
    Evelyne Schreiner avatar
    20 posts
    Member since:
    Sep 2009

    Posted 24 Jun 2010 Link to this post

    That's exactly what I needed. Thank you for the fast answer, Yana.
Back to Top