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

css styles for rad menu binded with XML

2 Answers 73 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Harin Yadav
Top achievements
Rank 2
Harin Yadav asked on 18 Feb 2011, 10:20 AM
HI

im using Radmenu.loadxml() to bind my Menu
1)
my menu is having 2 levels with two differnt css function for each level,i..e(.level1{},.level2{})
i want to change the main menu element background-colour when the submenu is hoverd or clicked

2)
display second element of main menu in 2 lines

How to achive these two?Please help.

Thanks
Harin

2 Answers, 1 is accepted

Sort by
0
Harin Yadav
Top achievements
Rank 2
answered on 18 Feb 2011, 12:05 PM
HI

i Have fixed the 2 nd one
please help fixing the first one
0
Kate
Telerik team
answered on 21 Feb 2011, 09:14 AM
Hi Harin Yadav,

You can set the css classes to the menu items directly in the xml file and apply the respective class like:
<Menu Text=" ">
  <Group Text="My Tracker" Url="#">
 
  <Item Text="European cities" Url="" >
    <Group >
    <Item Text="Berlin" Url="http://en.wikipedia.org/wiki/Berlin" CssClass="Custom" />
    <Item Text="Paris " Url="http://en.wikipedia.org/wiki/Paris" CssClass="Custom" />
    <Item Text="Sofia" Url="http://en.wikipedia.org/wiki/Sofia"CssClass="Custom" />
      </Group>
  </Item>
  <Item Text="North American cities" Url="">
    <Group >
    <Item Text="Boston" Url="http://en.wikipedia.org/wiki/Boston" />
    <Item Text="San Francisco" Url="http://en.wikipedia.org/wiki/San_Francisco" />
    <Item Text="Seattle" Url="http://en.wikipedia.org/wiki/Seattle" />
    <Item Text="Toronto" Url="http://en.wikipedia.org/wiki/Toronto" />
      </Group >
</Group>
</Menu>

Another way is to use HighLightPath() function and just overwrite the .rmFocused if you need to change the color. 

Best wishes,
Kate
the Telerik team
Tags
General Discussions
Asked by
Harin Yadav
Top achievements
Rank 2
Answers by
Harin Yadav
Top achievements
Rank 2
Kate
Telerik team
Share this question
or