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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How can I place a UserControl in the header cell of GridGroupingControl?

Platform: WinForms |
Control: GridGroupingControl |
Published Date: April 30, 2011 |
Last Revised Date: February 12, 2016

In order to have a User Control in GridGroupingControl, the GridGenericCellModel and GridGenericCellRenderer classes have to be derived and the User Control that is designed must be made as a cellmodel in GridGroupingControl using these derived classes.

The following are the steps that need to be followed:

Step 1: The UserControl form is added to the Project and the required controls are dropped into it.

In the UserControl, the OnLayout() method is overridden for positioning the inner button controls.

C#

VB

Step 2: Create CustomControlCellModel by deriving it from GridGenericCellModel class.

C#

VB

Step 3: Create CustomControlCellRenderer from the GridGenericCellRenderer class and the UserControl is drawn accordingly to fit into the required cell header.

C#

VB

Step 4: You can create a new CellType by adding the instance of the derived CustomControlCellModel class into the gridGroupingControl’s CellModels.

C#

VB

Step 5: Set the CustomControl into the specific header cell.

C#

VB

After applying the properties, the Grid is displayed as follows.

Figure 1: Grid with the properties

Sample Links

CS: UserControl

VB: UserControl

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon