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

7 posts, 0 answers
  1. John Hadjioannou
    John Hadjioannou avatar
    30 posts
    Member since:
    Dec 2005

    Posted 30 May 2010 Link to this post

    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
  2. Yana
    Admin
    Yana avatar
    5013 posts

    Posted 02 Jun 2010 Link to this post

    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.
  3. John Hadjioannou
    John Hadjioannou avatar
    30 posts
    Member since:
    Dec 2005

    Posted 02 Jun 2010 Link to this post

    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
  4. Yana
    Admin
    Yana avatar
    5013 posts

    Posted 02 Jun 2010 Link to this post

    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.
  5. John Hadjioannou
    John Hadjioannou avatar
    30 posts
    Member since:
    Dec 2005

    Posted 02 Jun 2010 Link to this post

    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


  6. John Hadjioannou
    John Hadjioannou avatar
    30 posts
    Member since:
    Dec 2005

    Posted 02 Jul 2010 Link to this post

    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
  7. John Hadjioannou
    John Hadjioannou avatar
    30 posts
    Member since:
    Dec 2005

    Posted 06 Jul 2010 Link to this post

    I have solved it.

    The css should be:

    body .RadMenu .rightItem { float: right; } 

    rather than "div .RadMenu ..."

    john
Back to Top