This is a migrated thread and some comments may be shown as answers.
RadMenu Root item text
4 Answers 66 Views
This is a migrated thread and some comments may be shown as answers.
Mugdha Aditya
Top achievements
Rank 1
Mugdha Aditya asked on 21 Jul 2011, 02:38 PM
I have radmenu control on my web page.
on chiled menu click i want to know the root menu text name in

RadHistorickMenu_ItemClick() menthod.



can any1 help me on this??


         <telerik:RadMenu ID="RadHistorickMenu" Skin="MenuSkin" runat="server" EnableEmbeddedSkins="false" OnClientItemClicking="OnClientItemClicking"
                            EnableRoundedCorners="true" EnableShadows="true" Width="100%" OnItemClick="RadHistorickMenu_ItemClick"> 
                            <Items>
                                <telerik:RadMenuItem Text="Quarterly" >
                                    <Items>
                                        <telerik:RadMenuItem Text="I S"/>
                                        <telerik:RadMenuItem Text="O D"  />
                                    </Items>
                                </telerik:RadMenuItem>
                                <telerik:RadMenuItem Text="Annual" >
                                    <Items>
                                        <telerik:RadMenuItem Text="I S"  />
                                        <telerik:RadMenuItem Text="O D"  />
                                    </Items>
                                </telerik:RadMenuItem>
                            </Items>
                        </telerik:RadMenu>


i mean on click of IS or OD, it will give me Quarterly / Annual name.

4 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 1
answered on 21 Jul 2011, 03:52 PM
Hello Mugdha,

One approach is to hook OnClientItemClicked event and save the value in a HiddenField. Then access that hiddenfield from the MenuItemClick.
JS:
<script type="text/javascript">
function OnClientItemClicked(sender,args)
  {
     if(args.get_item().get_level()>=1)
     {
     var txt = args.get_item().get_parent().get_text();
     var val =document.getElementById("HiddenField1")
     val.value=txt;
     }
  }
</script>
C#:
protected void RadMenu1_ItemClick(object sender, Telerik.Web.UI.RadMenuEventArgs e)
   {
       string val = HiddenField1.Value;
       Response.Write(val);
   }
Thanks,
Shinu.
0
Mugdha Aditya
Top achievements
Rank 1
answered on 22 Jul 2011, 06:41 AM
Thnaks Shinu :)

it worked with small change.

var

val = document.getElementById('<%= hdnDisplyType.ClientID %>');

 


0
Mugdha Aditya
Top achievements
Rank 1
answered on 27 Jul 2011, 02:20 PM

 

/* <RadMenu / Black> */
    
.RadMenu_MenuSkin .rmRootGroup, 
.RadMenu_MenuSkin a.rmLink, 
.RadMenu_MenuSkin .rmText 
    background-color: transparent;  
    
.RadMenu_MenuSkin .rmRootGroup 
    background-repeat: repeat-x
    background-color: #717171
     
    
.RadMenu_MenuSkin .rmVertical 
    background-position: 0 -408px
    
/* <Root items> */
    
.RadMenu_MenuSkin, 
.RadMenu_MenuSkin a.rmLink 
    font: normal 12px/23px "Segoe UI", Arial, sans-serif
    color: #ffffff
    text-decoration: none
    
.RadMenu_MenuSkin a.rmLink, 
.RadMenu_MenuSkin .rmText 
    background-repeat: no-repeat
    background-position: 0 500px
    
.RadMenu_MenuSkin a.rmLink:hover, 
.RadMenu_MenuSkin a.rmFocused, 
.RadMenu_MenuSkin a.rmSelected 
    background-position: 0 -72px
    background-color : #dcdcdc; /* Selected menu*/
    color : #28638f
    font-weight:bold
    
.RadMenu_MenuSkin .rmLast a.rmExpanded .rmText 
    background-position: 0 500px
    background-repeat: no-repeat
    
.RadMenu_MenuSkin a.rmDisabled, 
.RadMenu_MenuSkin a.rmDisabled:hover 
    color: #7d7d7d
    background-position: 0 500px
    
/* </Root items> */
    
.RadMenu_MenuSkin .rmVertical .rmLink, 
.RadMenu_MenuSkin .rmHorizontal .rmLink 
    margin-right: 5px; /* Distance between menu items*/
    
/* <Submenu items> */
    
.RadMenu_MenuSkin .rmGroup, 
.RadMenu_MenuSkin .rmMultiColumn, 
.RadMenu_MenuSkin .rmGroup .rmVertical 
    border: 1px solid #080808
    
.RadMenu_MenuSkin .rmTopFix, 
.RadMenu_MenuSkin .rmBottomFix, 
.RadMenu_MenuSkin .rmRoundedCorners .rmGroup .rmItem, 
.RadMenu_MenuSkin .rmRoundedCorners li.rmFirstGroupColumn .rmItem, 
.RadMenu_MenuSkin .rmRoundedCorners .rmFirstGroupColumn li.rmFirstGroupColumn .rmItem, 
.RadMenu_MenuSkin .rmRoundedCorners ul.rmHorizontal .rmFirst, 
.RadMenu_MenuSkin_Context.rmRoundedCorners .rmGroup .rmItem, 
.RadMenu_MenuSkin_Context.rmRoundedCorners ul.rmHorizontal .rmFirst 
    background-color: #717171;  
    background-repeat: repeat-y
    
* html .rmRoundedCorners_MenuSkin .rmGroup .rmItem, 
* html .rmRoundedCorners_MenuSkin ul.rmHorizontal .rmFirst 
    background-color: #717171;  
    background-repeat: repeat-y
    
    
.RadMenu_MenuSkin .rmRoundedCorners .rmGroupColumn 
    background-color: #717171
    
.RadMenu_MenuSkin .rmRoundedCorners .rmScrollWrapContainer .rmTopFix, 
.RadMenu_MenuSkin .rmRoundedCorners .rmScrollWrapContainer .rmBottomFix, 
.RadMenu_MenuSkin_Context.rmRoundedCorners .rmScrollWrapContainer .rmTopFix, 
.RadMenu_MenuSkin_Context.rmRoundedCorners .rmScrollWrapContainer .rmBottomFix 
    background: #717171
    
* html .rmRoundedCorners_MenuSkin .rmScrollWrapContainer .rmTopFix, 
* html .rmRoundedCorners_MenuSkin .rmScrollWrapContainer .rmBottomFix 
    background: #717171
}
i mean on click of IS or OD, it will change back color or css of Quarterly / Annual (root menu) in css.
can any one help me with this?
0
Kate
Telerik team
answered on 27 Jul 2011, 04:13 PM
Hello Mugdha,

Please take a look at the following forum post where I have just answered your question.

Best wishes,
Kate
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Menu
Asked by
Mugdha Aditya
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Mugdha Aditya
Top achievements
Rank 1
Kate
Telerik team
Share this question
or