Open RadMenuItem PopUp Bottom Right

5 posts, 0 answers
  1. Seth
    Seth avatar
    3 posts
    Member since:
    Oct 2016

    Posted 12 Dec 2016 Link to this post

    Does anyone know how to make the RadMenuItem PopUp open to the bottom right? 

    DropDownPlacement has Bottom, Top, Right, Left and Auto.  But I cannot find a way to move the popup to the bottom right.  

  2. Nasko
    Admin
    Nasko avatar
    693 posts

    Posted 13 Dec 2016 Link to this post

    Hi Seth,

    Currently the desired positioning of the MenuItem is not supported by RadMenu out of the box. However, what we could suggest you in order to achieve the desired is to handle the SubmenuOpened event of the MenuItem. Inside it using the ChildrenOfType<T> method to find the Popup inside which the MenuItems are placed and position it as desired using its Placement, PlacementTarget, PlacementRectangle etc. properties.

    We have created a sample project that demonstrates that approach.

    Hope this helps.

    Regards,
    Nasko
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Seth
    Seth avatar
    3 posts
    Member since:
    Oct 2016

    Posted 13 Dec 2016 in reply to Nasko Link to this post

    That is very close to what I need.  I do need the bottom right....however I need the popup to move over beneath the RadMenuItem. However the PopUp Width is null...so basically in the code you sent I would want the following....however popup.ActualWidth is null....is there a way to capture the width of the popup?

     private void RadMenuItem_OnSubmenuOpened(object sender, RadRoutedEventArgs e)
            {
                RadMenuItem menuItem = sender as RadMenuItem;
                if (menuItem != null)
                {
                    Popup popup = menuItem.ChildrenOfType<Popup>().FirstOrDefault();
                    if (popup != null)
                    {
                        popup.Placement = System.Windows.Controls.Primitives.PlacementMode.Bottom;
                        // Set the desired offset as desired
                        popup.HorizontalOffset = (menuItem.ActualWidth - popup.ActualWidth);
                    }
                }
            }

     

  4. Seth
    Seth avatar
    3 posts
    Member since:
    Oct 2016

    Posted 13 Dec 2016 in reply to Seth Link to this post

    I figured it out by drilling down through the properties of the PopUp.  

    popup.HorizontalOffset = (menuItem.ActualWidth - ((Grid) popup.Child).ActualWidth);

  5. Nasko
    Admin
    Nasko avatar
    693 posts

    Posted 14 Dec 2016 Link to this post

    Hi Seth,

    I am really glad to here the provided approach helped you to achieve the desired behavior and now everything is working as expected for you.

    If you have any additional questions or concerns please, do not hesitate to contact us.

    Regards,
    Nasko
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top