RadMenuItem (Can I run the menu in duplicate?)

1 Answer 55 Views
Menu
kim
Top achievements
Rank 1
kim asked on 20 Apr 2022, 05:54 PM

Hello.

I'm leaving you a question because I need your help.

Is there a way to run multiple windows of the same menu? Just like below.

* Menu Example

--------------------------------------------------------------------------------

A MENU    |    B MENU    |    C MENU

--------------------------------------------------------------------------------

B Sub Menu    |     B Sub Menu    |    B Sub Menu

--------------------------------------------------------------------------------

 

Code for generating the menu currently in use.

 

* CODE

var menuList = MenuList.List.Where(x => x.DISPLAY_FLAG.Equals("Y"));
                foreach (FT_MENU_INFO menu in menuList)
                {
                    if (string.IsNullOrWhiteSpace(menu.PARENT_MENU_CD) 
                        || menu.MENU_CODE.Equals(menu.PARENT_MENU_CD))
                    {
                        var item = new RadMenuItem { Text = menu.MENU_NAME };
                        item.Padding = new Padding(0, 0, 3, 0);
                        item.ClickMode = ClickMode.Press;
                        item.ShowArrow = false;
                        item.Visibility = ElementVisibility.Visible;

                        var subMenuItem = menuList.Where(x => x.PARENT_MENU_CD != null && x.PARENT_MENU_CD.Equals(menu.MENU_CODE)).ToArray();
                        for (int i = 0; i < subMenuItem.Length; i++)
                        {
                            RadMenuItem subMenu = new RadMenuItem()
                            {
                                Text = subMenuItem[i].MENU_NAME,
                                Name = subMenuItem[i].MENU_CODE
                            };

                            subMenu.Click += Menu_Click;
                            item.Items.Add(subMenu);
                        }

                        this.radMenu.Items.Add(item);
                    }
                }

 

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 21 Apr 2022, 09:54 AM

Hi kim,

Thank you for the provided details but I think I am not sure that I have fully understood your approach. Looking at the code snippet, you could have sub RadMenuItems for each of the main menuitems. However, this is not what you are looking for. I have prepared a sample project using your code snippet. May I ask you to take a look at it and elaborate more on your approach? You can send me an image of what you are trying to achieve by looking at the attached project.

I am looking forward to your reply.

Regards,
Dinko
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

kim
Top achievements
Rank 1
commented on 25 Apr 2022, 12:15 PM

Helol.

Hello. Thank you for your active support.

I am sending you an image attached.

What I want is to run multiple same menus.

What you want to do with this task is to look at different data by searching different search criteria in the same menu.

Please tell me if there is not enough explanation. I'll explain it in more detail. Thank you.

Dinko | Tech Support Engineer
Telerik team
commented on 27 Apr 2022, 06:03 AM

Thank you for the additional details. I think I understand your requirement. 

The RadMenu control provides a RadMenuHostItem element which can be used to place custom control inside a menu item. I would recommend checking the Nesting RadCotrols in the Menu Items section of our documentation article. This section describes in detail how you could place RadPageView control inside RadMenuItem. To demonstrate how you could have nested RadMenu control, you can take a look at the following code snippet.

RadMenu subMenu2 = new RadMenu();
subMenu2.Orientation = Orientation.Horizontal;
RadMenuItem subRrootItem = new RadMenuItem() { Text = "Child root" };
subMenu2.Items.Add(new RadMenuItem() { Text = "A" });
subMenu2.Items.Add(new RadMenuItem() { Text = "B" });
subMenu2.Items.Add(new RadMenuItem() { Text = "C" });
//subMenu2.Items.Add(subRrootItem);
RadMenuHostItem hostItem = new RadMenuHostItem(subMenu2);
hostItem.MinSize = new Size(100,20);
subRrootItem.Items.Add(hostItem);
subRrootItem.PopupDirection = RadDirection.Down;
RadMenuItem root = new RadMenuItem() { Text = "Root" };
this.radMenu1.Items.Add(root);
root.Items.Add(subRrootItem);

Give this approach a try and let me know if it works for you.

In addition, in your image, you want to filter RadGridView. If you want to have a filter option only, you could check our Filter View control. This control provides filtering options out of the box like the most popular shipping sites. You can check it out and see if it is going to work for you.

I hope that you find this reply helpful.

 

 

Tags
Menu
Asked by
kim
Top achievements
Rank 1
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or