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

RadDropDownMenu

2 Answers 74 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Santiago
Top achievements
Rank 1
Santiago asked on 15 Nov 2007, 04:40 PM
Hi, I'm working with two monitors. When I move the treeview to the secondary monitor, the context menu of every node is displayed in the main monitor. It occurs too with the control demo installed with the components, so, I suposs that it's a bug.

Another thing, text displayed in the context menu are not aligned. I change every TextAlignment of each item, but what are displayed at runtime is very different.

Thanks.

2 Answers, 1 is accepted

Sort by
0
Angel
Telerik team
answered on 19 Nov 2007, 05:15 PM
Hi Santiago,

Sorry for the delay.
  1. Indeed there is an issue with the positioning of the context menus on multimonitor systems. It will be fixed for in upcoming releases.
  2. The layout of the menu items is done so that the container of the text and the image is not stretched to the whole width of the popup menu you see. This forces you to align the container instead of the primitives inside it. Here is sample code that aligns all menu items to the right of a menu element with the hint aligned to the left:

C#:

for (int i = 0; i < this.radDropDownMenu1.Items.Count; i++)     
{     
    RadElement imageAndTextLayout = this.radDropDownMenu1.Items[i].Children[1].Children[0];     
    imageAndTextLayout.Alignment = ContentAlignment.TopRight;     
    RadElement hintTextPrimitive = this.radDropDownMenu1.Items[i].Children[1].Children[1];     
    hintTextPrimitive.Alignment = ContentAlignment.TopLeft;     
}    
 


VB:

Dim i As Integer = 0    
Do While i < Me.radDropDownMenu1.Items.Count    
    Dim imageAndTextLayout As RadElement = Me.radDropDownMenu1.Items(i).Children(1).Children(0)     
    imageAndTextLayout.Alignment = ContentAlignment.TopRight     
    Dim hintTextPrimitive As RadElement = Me.radDropDownMenu1.Items(i).Children(1).Children(1)     
    hintTextPrimitive.Alignment = ContentAlignment.TopLeft     
    i += 1     
Loop    
 

In the future, we intend to modify the layout and possibly the hierarchy of the drop down menu. Either way, the code given here will become incorrect. After we make these changes, you will be able to align the text in a simpler way than the one that is given here.

Sincerely yours,
Angel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Stefan
Telerik team
answered on 21 Mar 2011, 10:13 AM
Hi Santiago,

Please note that in Q1 2011 we have introduced a major upgrade of RadTreeView control, which is now virtualized and fully customizable. Feel free to download the latest release and try it out. For more information on our latest release refer to this blog post.
 
Kind regards,
Stefan
the Telerik team
Tags
Treeview
Asked by
Santiago
Top achievements
Rank 1
Answers by
Angel
Telerik team
Stefan
Telerik team
Share this question
or