[Question]: KryptonRibbon/RibbonAppButton/AppButtonMenuItems fails in designer and in code
See original GitHub issueDescribe the bug
While designing a ribbon control, I am unable to design the app button menu. Specifically, the AppButtonMenuItems
collection fails to add menu items because the designer is trying to add an instance of KryptonContextMenuItemBase
but it is an abstract class.
To Reproduce Steps to reproduce the behavior:
- Open up the Forms Designer
- Add a
KryptonRibbon
- Expand the
RibbonAppButton
node in the properties window - Click On the ellipsis
[..]
of theAppButtonMenuItems
row - Click the
Add
button under the members’ list.
Expected behavior
I expected a new KryptonContextMenuItem
to be added to the collection and its properties displayed for editing on the property grid inside the dialog box.
Screenshots
Here is an image of the error message in the designer when the AppButtonMenuItems
collection dialog is opened up and a new item is added.
Desktop (please complete the following information):
- OS: Windows 10
- Version 22H2
- Visual Studio 2017/2022
- WinForms/.NET Framework 4.8
Additional context I tried adding the menu items programmatically when the form loads with the following code
KryptonContextMenuItem newItem = new KryptonContextMenuItem("New")
{
SplitSubMenu = true,
};
KryptonContextMenu menu = new KryptonContextMenu()
{
PaletteMode = PaletteMode.Global,
};
menu.Items.Add(newItem);
kryptonRibbon1.RibbonAppButton.AppButtonMenuItems.Add(menu);
and I get an argument exception with the message Type to be added is not allowed in this collection.
when the menu.Items.Add(newItem);
command is reached.
Issue Analytics
- State:
- Created 5 months ago
- Comments:7 (4 by maintainers)
I installed 70.22.11.312 from NuGet and replaced the references.
The problem is fixed now.
Thank you for your time.
John Alexiou
From: Peter @.> Sent: Tuesday, April 18, 2023 12:27 PM To: @.> Cc: John @.>; @.> Subject: Re: [Krypton-Suite/Standard-Toolkit] [Bug]: KryptonRibbon/RibbonAppButton/AppButtonMenuItems fails in designer and in code (Issue #1005)
Hi @ja72https://github.com/ja72
Unfortunately we don’t support 4.6.0.0. It looks as if the version that you’re currently using is a older version (CF) from 2017. Please check herehttps://github.com/Krypton-Suite/Krypton-Toolkit-Suite-Version-Dashboard for currently supported versions.
cc. @Smurf-IVhttps://github.com/Smurf-IV
— Reply to this email directly, view it on GitHubhttps://github.com/Krypton-Suite/Standard-Toolkit/issues/1005#issuecomment-1513466237, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AFLXN2KZU4UD2D6QBVFQU7LXB26IPANCNFSM6AAAAAAXCVY6WI. You are receiving this because you were mentioned.Message ID: @.***>
No problem