RadMenuItem - arrow position

1 Answer 72 Views
Menu
Ian
Top achievements
Rank 2
Bronze
Iron
Iron
Ian asked on 04 Nov 2021, 03:48 PM

RadMemnuItems have a .showArrow propery, which shows a little triangle to the right of the item, to indiate there are sub-items.

Does anyone know how to make the arrow appear at the bottom of the item? There 's Direction property, but that changes where the wrrow points, which is useful, but does not change its position.

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 06 Nov 2021, 10:13 PM

Hi Ian,

Thank you for your interest in our RadMenu control for WinForms.

The RadMenuItems does not provide a way to position the arrow at the bottom center place of the element. However, you could try to manually move it to the desired place. To do that, you can create a custom class that derives from the RadMenuItem. Then you can override the ArrangeOverride and call the Arrange method of the ArrowPrimitive from the Layout property. The final step is to pass a new RectangleF object which specified size and position. The code should look like the following one.

public class MyMenuItem: RadMenuItem
{
    protected override Type ThemeEffectiveType
    {
        get
        {
            return typeof(RadMenuItem);
        }
    }       

    protected override SizeF ArrangeOverride(SizeF finalSize)
    {
        SizeF s = base.ArrangeOverride(finalSize);

        this.Layout.ArrowPrimitive.Arrange(new RectangleF(this.Layout.DesiredSize.Width/2, this.DesiredSize.Height - 20, 10,10));
        return s;
    }
} 

As a side note, when moving the arrow at the bottom, you will need to give the element enough space. What you can try is to add a new line in the Text property of the custom RadMenuItem.

 MyMenuItem menuItem = new MyMenuItem() { Text= "Item 1 \n ", ShowArrow = true};

I hope this approach will work for you.

Regards,
Dinko
Progress Telerik

Remote troubleshooting is now easier with Telerik Fiddler Jam. Get the full context to end-users' issues in just three steps! Start your trial here - https://www.telerik.com/fiddler-jam.
Ian
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 09 Nov 2021, 09:52 AM

Wow! That looks like a lot of work for a little arrow!

I think I'll spend the time trying to presuade my users to keep the arrow on the right.

Thanks

Tags
Menu
Asked by
Ian
Top achievements
Rank 2
Bronze
Iron
Iron
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or