We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Create custom component from GroupBar with initial GroupBarItems


I try create a custom component from GroupBar Control.

I would like add 2 default GroupBarItems (with name: PanelPrimary, PanelSecondary) and add it to the initial state of my custom component. I can build the code, but I cannot place the component in Form, because I get this error message after I drag the control from toolbar:

I mark the code part with bold that cause the error:

So I add new Component Class to my project and add this code:

    public partial class MyAlternatePanel : GroupBar


        public Syncfusion.Windows.Forms.Tools.GroupBarItem PanelPrimary;

        public Syncfusion.Windows.Forms.Tools.GroupBarItem PanelSecondary;

        public MyAlternatePanel()





        public MyAlternatePanel(IContainer container)






        private void Build() {

            this.BackColor = System.Drawing.SystemColors.Control;

            this.BorderColor = System.Drawing.Color.White;

            this.BorderStyle = System.Windows.Forms.BorderStyle.None;

            this.ExpandButtonToolTip = null;

            this.FlatLook = true;

            this.ForeColor = System.Drawing.Color.White;

            this.GroupBarDropDownToolTip = null;

            this.GroupBarItemHeight = 0;

            this.IndexOnVisibleItems = true;

            this.MinimizeButtonToolTip = null;

            this.NavigationPaneButtonWidth = 0;

            this.NavigationPaneHeight = 0;

            this.NavigationPaneTooltip = null;

            this.PopupClientSize = new System.Drawing.Size(0, 0);

            this.PopupResizeMode = Syncfusion.Windows.Forms.Tools.PopupResizeMode.None;

            this.ShowChevron = false;

            this.ShowNavigationPane = false;

            this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;

            this.SmartSizeBox = false;

            this.ThemeName = "Metro";

            this.ThemeStyle.BorderThickness = 0;

            this.VisualStyle = Syncfusion.Windows.Forms.VisualStyle.Metro;

            // this.PanelPrimary.Client = new Panel(); <- I would like add this in form-designer

            this.PanelPrimary.Text = "Primary Panel [ID: 0]";

            this.PanelPrimary.Visible = false;

            // this.PanelSecondary.Client = new Panel(); <- I would like add this in form-designer

            this.PanelSecondary.Text = "SecondaryPanel [ID: 1]";

            this.PanelSecondary.Visible = false;

            this.GroupBarItems.AddRange(new Syncfusion.Windows.Forms.Tools.GroupBarItem[] {






I would like to add child control to the PanelPrimary and PanelSecondary GroupbarItems in form designer. (I can switch with editing the SelectedItem property at design time).

Do you have any idea how should I modify the bold part of code to accept initial groupbaritems definition and show the control properly in VS form designer?

Thank you very much!

Best Regards, SZL

2 Replies

KA Karthick Arjunan Syncfusion Team January 25, 2023 01:47 PM UTC


We are validating your reported issue. We will provide the solution or complete details within two business days.

KA Karthick Arjunan Syncfusion Team January 27, 2023 12:37 PM UTC


To resolve this issue, you will need to create instances for the GroupBarItems: PanelPrimary and PanelSecondary and add them to the initial state of your custom component. This can be done by adding the following code snippet to your project:

public GroupBarItem PanelPrimary = new GroupBarItem();

public GroupBarItem PanelSecondary = new GroupBarItem();

You can also create instances for GroupBarItems in the constructor of your custom component. We have also provided a simple sample for your reference.

Please let us know if you have any other queries.

Attachment: GroupBar_Sample_4018215d.zip

Live Chat Icon For mobile
Up arrow icon