FIX. Exception is thrown when opening mdi child in a project build for Release.
FIX. RadMenuItem does not repaint itself after being re-enabled
RadMenu does not clear its IsMouseDown state after being clicked and the pointer leaves the menu item before the mouse button is released
After adding a few items in RadMenu, and changing their visibility settings: 1.When turned back to visible, they does not appear 2. When they are collapsed, their empty spots are still there (although AutoSize = true) int i = 1; void radMenuItem1_DropDownOpening(object sender, CancelEventArgs e) { if (i == 0) { radMenuButtonItem2.Visibility = Telerik.WinControls.ElementVisibility.Collapsed; radMenuButtonItem3.Visibility = Telerik.WinControls.ElementVisibility.Collapsed; i++; } else { radMenuButtonItem2.Visibility = Telerik.WinControls.ElementVisibility.Visible; radMenuButtonItem3.Visibility = Telerik.WinControls.ElementVisibility.Visible; i--; } radMenuItem1.DropDown.PopupElement.InvalidateMeasure(); radMenuItem1.DropDown.PopupElement.InvalidateArrange(); radMenuItem1.DropDown.PopupElement.UpdateLayout(); }
When RadMenu is on focus and some of the RadMenuItems has visibility set to Hidden those items should be visible in design time.
FIX. RadContextMenu/RadMenu - animations does not perform correctly on Windows 8 WORKAROUND Execute ThemeResolutionService.AllowAnimations = false; before the context menu is opened and then Allow animations again when the context menu is closed
Add two menu items to a context menu and set their texts to "&Command 1" and "&Command 2". Add some actions to to be executed when each is clicked. Set the visibility of the first one to hidden or collapsed and run the project. Open the context menu and press the "C" key. You will see that the action of the first menu item will be executed although only the second is visible in the context menu.
To reproduce: - Add RadMenu with some items to a blank form. - Initialize the menu like this: Me.RadMenu1.RightToLeft = System.Windows.Forms.RightToLeft.Yes Me.RadMenu1.DropDownAnimationEnabled = True Me.RadMenu1.DropDownAnimationFrames = 30 Me.RadMenu1.DropDownAnimationEasing = RadEasingType.OutElastic - Show the item drop down manually : Private Sub RadMenuItem_MouseHover(sender As Object, e As EventArgs) Dim item As RadMenuItem = TryCast(sender, RadMenuItem) If item IsNot Nothing Then item.DropDown.Show() End If End Sub
To reprodue: -Add a RadMenu with several items and sub items. -Add shortcuts for some of the sub items (e.g. CTRL + SHIFT + A). -Run the application and press CTRL + SHIFT + A. As a result the Click event for the specific items is fired. This is correct behavior. -If you add a RadButton, which Click event shows a RadMessageBox and display the message box before pressing CTRL + SHIFT + A, the Click event for the certain item is fired again, although the main form is currently not active. Workaround: public class CustomRadMenuItem : RadMenuItem { public CustomRadMenuItem(string text) : base(text) { } protected override Type ThemeEffectiveType { get { return typeof(RadMenuItem); } } protected override bool CanHandleShortcut(ShortcutEventArgs e) { Control owner = this.OwnerControl; if (owner == null) { return false; } Form form = owner.FindForm(); if (form == null) { RadDropDownMenu toolTipOwner = owner as RadDropDownMenu; if (toolTipOwner != null && toolTipOwner.Owner != null) { form = ((RadMenuElement)this.Owner).ElementTree.Control.FindForm(); if (form != null) { Form activeForm = e.FocusedControl == null ? Form.ActiveForm : e.FocusedControl.FindForm(); return form == activeForm || form.ContainsFocus; } } } return base.CanHandleShortcut(e); } }
To reproduce: 1. Add a RadMenu with one item which has one child item. 2. Click on "radMenuItem1" then will appear "radMenuItem2 " . - Keep ("radMenuItem2") open and do not click on it - 3. Go out of the form and click on empty area . 4. Return to the menu and just move mouse over the "radMenuItem1" and it will appear "radMenuItem2" and also move the mouse over the "radMenuItem2" and keep it open . ("do not click on menus") 5. Go out of the form and click the Show Desktop button on the bottom right of the screen 6. Now you can see the problem , the menu has not closed Workaround: override the WndProc method in your Form with the following: protected override void WndProc(ref Message m) { if (m.Msg == NativeMethods.WM_SIZE && (int)m.LParam == 0 && (int)m.WParam == 1) { PopupManager.Default.CloseAll(RadPopupCloseReason.AppFocusChange); } base.WndProc(ref m); } if the above does not work, you can try the following: private void Form1_Deactivate(object sender, EventArgs e) { PopupManager.Default.CloseAll(RadPopupCloseReason.AppFocusChange); }
To reproduce: RadMenuItem item = new RadMenuItem(); item.Text = "Item1"; RadMenuComboItem comboItem = new RadMenuComboItem(); comboItem.ComboBoxElement.DropDownStyle = RadDropDownStyle.DropDownList; comboItem.Items.Add("meters"); comboItem.Items.Add("feet"); item.Items.Add(comboItem); this.radApplicationMenu1.Items.Add(item); The undesired behavior is illustrated better in the attached file. Workaround: item.DropDownClosing += item_DropDownClosing; comboItem.ComboBoxElement.EditableElement.MouseDown += EditableElement_MouseDown; comboItem.ComboBoxElement.EditableElement.MouseUp += EditableElement_MouseUp; bool shouldCancel = false; private void EditableElement_MouseUp(object sender, MouseEventArgs e) { shouldCancel = false; } private void EditableElement_MouseDown(object sender, MouseEventArgs e) { shouldCancel = true; } private void item_DropDownClosing(object sender, RadPopupClosingEventArgs args) { args.Cancel = shouldCancel; } private void ComboBoxElement_SelectedIndexChanged(object sender, PositionChangedEventArgs e) { RadDropDownListElement ddle = sender as RadDropDownListElement; if (ddle != null && e.Position < ddle.Items.Count) { RadMessageBox.Show(ddle.Items[e.Position].Text); } }
Add text to separator items
To reproduce: 1. Drag and drop RadMenu on form. 2. Add few items 3. Set design time the ForeColor of of RadMenuItem to red. The ForeColor is changed. 4. Run the form and you will see that the ForeColor of RadMenuItem is black again. Workaround: 1. Set the ForeColor run time using following code snippet: this.radMenuItem1.ForeColor = Color.Red; 2. Set the ForeColor of TextPrimitive through Element hierarchy editor. You can see the DesignTimeSetForeColorOfRadMenuItem.png image how to set it.
Such a functionality needs to be defined on an application level. In the 2018 R2 release we have added Recently Used Menu items in the Visual Style Builder application and the approach there can serve as an example.
When right clicking on a control near the bottom of the screen, the context menu (implemented as a RadContextMenu) opens downwards from the point where the mouse was clicked. This results in the majority of the menu going off the bottom of the screen. On subsequent right clicks in the same area, the context menu opens upwards from the click position, which is correct functionality as the menu is not obscured. The menu is shown by calling: contextMenu.Show(viewerControl, e.Location); The bug occurs the first time that the context menu is shown on a control.
You can use following workarounds: 1)The menu items are components and you can edit any menu item directly in your code. For example: this.radMenuItem10.Click+=menuItemClickMethod; Also you can selected and edit them in these ways: 2) Selected a particular menu item via Visual Studio's Document Outline window (ctrl+W, U). Then you will be able to selected the desired item from the hierarchy. After that item will be selected in the property grid and you can add/remove events and edit its properties. 3) You can select a specific menu item directly via Visual Studio's Property Grid's Component combobox (on the top of the property grid)
To reproduce: 1. Add RadForm and set the following properties at design time: this.AutoSize = true; this.WindowState = FormWindowState.Maximized; this.Size = new Size(750, 500); 2. Add RadMenu and add more than 10 menu items 3. Run the application and you will see that menu items are overlapped (see the attached image) Workaround: Restore the WindowState of form to Normal at design time and set the WindowState to Maximized run time in the Load event of form. Here is the snippet: private void RadForm1_Load(object sender, EventArgs e) { this.WindowState = FormWindowState.Maximized; }
The default value of the RadMenuButtonItem.TextImageRelation property was ImageBeforeText until Q3 2014 after which it has changed to Overlay.
Workaround: foreach (RadMenuItem item in radMenu1.Items) { item.Layout.Text.Font = new Font("Tahoma", 12, FontStyle.Bold); }