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

How do I get somemenu items on the left and one on the right?

6 Answers 191 Views
Menu
This is a migrated thread and some comments may be shown as answers.
John Hadjioannou
Top achievements
Rank 1
John Hadjioannou asked on 30 May 2010, 04:25 PM
I'd like a horizontal menu that
    (1) spans the whole window
    (2) with the menu items ranged on the left
so far so good - I can get this "out of the box"
    (3) with just one menu item at the right of the menu bar

ie:  something like:

M1..M2..M3..M4......................................................M5

It's a multi-level menu with a database datasource.

Any suggestions how I might achieve this effect?

Thanks
John

6 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 02 Jun 2010, 12:56 PM
Hello John,

Please use the following code to achieve the needed layout:

<telerik:RadMenu ID="RadMenu1" runat="server" Width="100%">
    <Items>
        <telerik:RadMenuItem Text="last item" OuterCssClass="rightItem" />
        <telerik:RadMenuItem Text="item1" />
        <telerik:RadMenuItem Text="item2" />
        <telerik:RadMenuItem Text="item3" />
    </Items>
</telerik:RadMenu>

and "rightItem" css class:

div.RadMenu .rightItem { float: right; }

Best wishes,
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
John Hadjioannou
Top achievements
Rank 1
answered on 02 Jun 2010, 02:54 PM
Hi Yana

Thank you for your help.

I have two problems:

1.  When I copy and paste of the solution to test it, Visual Studio tells me that OuterCssClass is not a valid attribute of RadMenuItem
2.  My menu is bound to a database - can I do this based on values in the database?

Thanks
John
0
Yana
Telerik team
answered on 02 Jun 2010, 03:42 PM
Hi John,

1. Which version of the controls you're using? This property is available since Q2 2009 SP1 (version 2009.2.826) .

2. You can use ItemDataBound event and set it only to the needed items.

Kind 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
John Hadjioannou
Top achievements
Rank 1
answered on 02 Jun 2010, 04:03 PM
Hi Yana

I was using 2009, 2, 701, 35 - that explains the missing OuterCssClass property.

The ItemDataBound should solve the other problem.

Thanks again
John


0
John Hadjioannou
Top achievements
Rank 1
answered on 02 Jul 2010, 01:02 PM
I thought I had this problem solved ... but ...

When I incorporate the control in the larger application (it's an Ironspeed app) the OuterCSS is not applied for some reason i can't work out, so I have set

e.Item.Style.Add(

"float", "right")

 

 

 

 

 


in ItemDataBound instead.  It positions the menu item to the right as intended, but submenus open in the place that they would have occupied had the menu item been on the left.  How do I fix this, please?

John
0
John Hadjioannou
Top achievements
Rank 1
answered on 06 Jul 2010, 09:23 PM
I have solved it.

The css should be:

body .RadMenu .rightItem { float: right; } 

rather than "div .RadMenu ..."

john
Tags
Menu
Asked by
John Hadjioannou
Top achievements
Rank 1
Answers by
Yana
Telerik team
John Hadjioannou
Top achievements
Rank 1
Share this question
or