How to reproduce: Add a RadContextMenu and an ImageList to a form, then add some images to the image list and set the ImageList property of the context menu to equal the image list object. Add some items and sub items to the context menu. Setting the image index of a sub item is not reflected by the context menu. Workaround: 1. Design time: and the images as resources and set the image property of each item 2. Set the image index of the sub items at runtime
To reproduce: 1. Add a new form 2. Drag and drop RadApplicationMenu on the form 3. Add RadMenuSeparatorItem at design time 4. Save the form 5. Press Ctrl + Z to undo changes 6. Press Ctrl + Y to redo changes 7. An exception is thrown with message: Object of type 'System.Boolean' cannot be converted to type 'Telerik.WinControls.ElementVisibility'.
Workaround: set the TextImageRelation property of the items to ImageBeforeText, you can also check the attached gif file
To reproduce - Set the item text like this: this.radMenuItem3.Text = "&Пункт меню"; Workaround: class Item : RadMenuItem { protected override RadDropDownMenu CreateDropDownMenu() { return new MyDropDownMenu(this); } protected override Type ThemeEffectiveType { get { return typeof(RadMenuItem); } } } class MyDropDownMenu : RadDropDownMenu { public MyDropDownMenu(RadMenuItem owner) : base(owner) { } protected override bool ProcessMnemonic(Keys keyData) { var charKey = VirtualKeyCodeToUnicode(keyData); List<RadItem> mnemonicItems = new List<RadItem>(); int selectedIndex = -1; RadItem selectedItem = this.GetSelectedItem(); foreach (RadItem menuItem in this.Items) { if (IsMnemonic(charKey[0], menuItem.Text) && menuItem.Enabled && menuItem.Visibility == ElementVisibility.Visible) { mnemonicItems.Add(menuItem); if (selectedItem == menuItem) { selectedIndex = mnemonicItems.Count - 1; } } } if (mnemonicItems.Count == 1) { mnemonicItems[0].Select(); mnemonicItems[0].PerformClick(); return true; } else if (mnemonicItems.Count > 0) { selectedIndex = (selectedIndex + 1) % mnemonicItems.Count; mnemonicItems[selectedIndex].Focus(); this.SelectItem(mnemonicItems[selectedIndex]); return true; } return false; //return base.ProcessMnemonic(keyData); } public string VirtualKeyCodeToUnicode(Keys key) { uint virtualKeyCode = (uint) key; StringBuilder result = new StringBuilder(); byte[] keyboardState = new byte[255]; bool keyboardStateStatus = GetKeyboardState(keyboardState); if (!keyboardStateStatus) { return ""; } uint scanCode = MapVirtualKey(virtualKeyCode, 0); IntPtr inputLocaleIdentifier = GetKeyboardLayout(0); ToUnicodeEx(virtualKeyCode, scanCode, keyboardState, result, (int) 5, (uint) 0, inputLocaleIdentifier); return result.ToString(); } [DllImport("user32.dll")] static extern bool GetKeyboardState(byte[] lpKeyState); [DllImport("user32.dll")] static extern uint MapVirtualKey(uint uCode, uint uMapType); [DllImport("user32.dll")] static extern IntPtr GetKeyboardLayout(uint idThread); [DllImport("user32.dll")] static extern int ToUnicodeEx(uint wVirtKey, uint wScanCode, byte[] lpKeyState, [Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pwszBuff, int cchBuff, uint wFlags, IntPtr dwhkl); }
Use attached to reproduce!
Use attached to reproduce. Workaround: private void Item_Click(object sender, EventArgs e) { menu.DropDown.ClosePopup(new PopupCloseInfo(RadPopupCloseReason.CloseCalled,null)); }
Use attached to reproduce. - open the menu and press the down arrow. This disabled items should not be selected. Woekaround: public class MyMenuItem : RadMenuItem { public MyMenuItem() : base() { } public MyMenuItem(string text) : base(text) { } protected override RadDropDownMenu CreateDropDownMenu() { return new MyDropDown(this); } protected override Type ThemeEffectiveType { get { return typeof(RadMenuItem); } } } public class MyDropDown : RadDropDownMenu { public MyDropDown(RadElement owner) : base(owner) { } protected override bool ProcessUpDownNavigationKey(bool isUp) { var selectedItem = this.GetSelectedItem(); RadItem nextItem = selectedItem; do { nextItem = this.GetNextItem(nextItem, !isUp); } while (!nextItem.Enabled); this.SelectItem(nextItem); return true; } public override string ThemeClassName { get { return typeof(RadDropDownMenu).FullName; } set { } } }
To reproduce: - Add an item and then use the Clear method. - The arrow is still visible. Workaround: radMenuItem2.Layout.ArrowPrimitive.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
This is really bad for usability. When a user clicks on a seperator by accident the menu closes and nothing happens.