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

Docking RadMenu

3 Answers 208 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Taylor
Top achievements
Rank 1
Taylor asked on 09 Apr 2011, 10:15 PM
I have performed the following steps in trying to dock a radmenu.

1. Dock it to the top of a new RadForm with AutoSize set to true
2. Fill/dock another control (PageView, for example) on the form

There seems to be overlap that occurs between the controls, one of the controls will always hide (at least part of) the other.If I put a Windows menustrip in the same place, it behaves as expected and both controls coexist.  The radmenu looks like it is doing what is expected in design mode, but is completely covered/hidden at runtime. Putting the radmenu on a radpanel (that is set up to autosize/grow/shrink to its content) results in the panel shrinking down to zero 0 size (in the designer).  Is there a specific way to dock the menu with AutoSize enabled so the menu doesn't get overpowered by another docking control? 

3 Answers, 1 is accepted

Sort by
0
Ivan Todorov
Telerik team
answered on 13 Apr 2011, 04:46 PM
Hello Taylor,

I was unable to reproduce your scenario. You can try right clicking on RadMenu in the designer and selecting the "Send to Back" or "Bring to Front" actions. If this doesn't help, please post your code here using the Format Code Block or open a new support ticket and attach your project to it.

Hope this helps. If you have any additional questions, feel free to ask.

Best wishes,
Ivan Todorov
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
Taylor
Top achievements
Rank 1
answered on 14 Apr 2011, 04:49 AM
Hello Ivan,

Let me clarify in case you are not able to reproduce because the problem is not clear.  The issue I am encountering is a run-time issue where the layout differs from the design layout.  Essentially, the radmenu disappears.  The following steps walk you through recreating the issue as there is no major project setup required.

1. Create a new RadControls form application project.
2. Drag a RadMenu from the Toolbox onto Form1.  The menu defaults to Dock:Top.
3. Add a menu item to the menu so the menu has text on it and is more readily visible.
4. Drag a RadPageView from the Toolbar onto Form1. 
5, Set the PageView to Dock:Fill. 
6.  Add a Page so you can see a tab.

Attached are images so you can see the difference between the Design and Runtime.  It looks like it is an issue related to Docking and/or AutoSizing for the RadMenu.  Replacing the same menu with a windows forms menustrip with no change to properties results in the expected behavior as well.
0
Ivan Todorov
Telerik team
answered on 18 Apr 2011, 03:45 PM
Hello Taylor,

Thank you for providing me with the exact steps of reproducing the issue.

However, although I have followed them carefully, I am still unable to reproduce the behavior. There might be something specific in your project that I am missing, so I would kindly ask you to open a new support ticket and attach your project to it. This will let me investigate this case in detail and provide you with an appropriate answer.

I am looking forward to hearing from you.

Greetings,
Ivan Todorov
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
Pascal
Top achievements
Rank 1
commented on 23 Jul 2024, 06:27 AM

Hello!

Has this ever been resolved internally? I'm having the exact same issue.

  1. Create a UserControl, dock a RadMenu to Top and another control to Fill.
  2. Set AutoSize=True and AutoSizeMode=GrowAndShrink on the UserControl.
  3. Put this UserControl into a TableLayoutPanel with AutoSize row style and AutoSize=True and AutoSizeMode=GrowAndShrink.

By default, I'm getting this;

When I set AutoSize=False on the RadMenu (wich is true by default) it won't overlap:

However, the workaround to set AutoSize=False on the RadMenu isn't nice. The height depents on the theme wich is currently used. Not sure if there is anything else I could do or not. Maybe you can tell me an tipp from the old ticket what I missed?

Thank you!

Nadya | Tech Support Engineer
Telerik team
commented on 25 Jul 2024, 01:14 PM

Hello, Pascal,

I have carefully followed your instruction and create user control using RadMenu, but I was not able to observer overlapping as you demonstrated in the provided pictures. In order to investigate the case I will need the exact setup to reproduce the issue. It it possible for you to replicate the problem in a sample project. It is also possible to provide only the form file together with the designer so I can inspect it more precisely. Feel free to open a support ticket when providing files in order to respect your privacy. 

I am looking forward to your reply.

Pascal
Top achievements
Rank 1
commented on 26 Jul 2024, 05:05 AM

Hello!

Sure, I created a new small project solution and I was able to reproduce the issue again. There is no privacy problem, so I put it here. In the picture you can see all the custom code I made.

  1. Create a new C# Windows Forms app targeting ,NET 8.
  2. Add the nuget package "Telerik.For.WinForms.AllControls"
  3. Change the base type of Form1 to RadForm
  4. Create multiple menubars within child controls otherwise you will not see the issue (in this case at least). Changing "IsMainMenu" property had no effect for me in this case.
  5. Add more rows and see that only the last menu bar is drawn correctly. (In my productive project only the first menu bar draws correct, but maybe because it's the only menu bar directory on the Form, the others are in child controls).

Feel free to contact me if there is anything missing.

Thank you for looking into it! :)

Nadya | Tech Support Engineer
Telerik team
commented on 30 Jul 2024, 12:12 PM

Hello, Pascal,

Thank you for the provided project that shows your setup and reproduce the problem that you are facing.

After investigating it, it seems that there isn't enough space and RadMenu gets crumpled. To overcome this, you can set MinSize property of RadMenuItem:

var menuItem = new RadMenuItem
{
    Text = "Add",
    MinSize = new Size(0, 20),
};

After doing this, the RadMenu looks good in your custom control inside TableLayoutPanel:

I hope this helps. If you have other questions, please let me know.

Pascal
Top achievements
Rank 1
commented on 31 Jul 2024, 04:03 AM

Hello!

Nice to see that you were able to reproduce the issue!

Yes you're correct, adjusting MinSize property solves this problem, Already using this workaround. But you would need to adjust that with each theme as each theme needs another min size and I just prefer to keep such things automatically if possible.

However, if I'll find a solution to patch somewhen I will let you know here.

Thank you!

Nadya | Tech Support Engineer
Telerik team
commented on 31 Jul 2024, 02:34 PM

Hello, Pascal,

I am glad to hear that this solution is working for you in your custom setup with several user controls and tables. Do not hesitate to contact us, if you have any other questions or concerns.

Tags
Menu
Asked by
Taylor
Top achievements
Rank 1
Answers by
Ivan Todorov
Telerik team
Taylor
Top achievements
Rank 1
Share this question
or