)
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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to remove fields in WinForms GridGroupingControl?

Platform: WinForms |
Control: GridGroupingControl |
Published Date: May 23, 2015 |
Last Revised Date: December 24, 2019
Tags: databinding

Remove fields in GridGroupingControl

In GridGroupingControl, each time while creating columns, fields are also created along with it and in some cases the fields are unnecessary. Therefore, when there are many columns, then the fields related to it are also added and creates performance problem. To overcome the addition of fields in GridGroupingControl refer to the following solution.

Solution

To stop adding the fields to the GridGroupingControl, use the Modify() method. By using this method the fields are not added altogether. You can add the necessary fields alone, by using the TableDescriptor.Fileds.Add() method. In the following code example, there are 11 fields and only two fields “CompanyName” and “CustomerID” are added.

The following code example illustrates on how the Modify() method works.

C#

// this method stops adding fields in the Grid.
this.gridGroupingControl1.TableDescriptor.Fields.Modify();
// Adding necessary Fields.
this.gridGroupingControl1.TableDescriptor.Fields.Add("CompanyName");
this.gridGroupingControl1.TableDescriptor.Fields.Add("CustomerID ");

VB

'This method stops auto populating the fields in the Grid.
Me.gridGroupingControl1.TableDescriptor.Fields.Modify()
' Adding necessary Fields.
Me.gridGroupingControl1.TableDescriptor.Fields.Add("CompanyName")
Me.gridGroupingControl1.TableDescriptor.Fields.Add("CustomerID")

The following screenshot displays only two fields, CompanyName and CustomerID.

Only two fields displayed in GridGroupingControl

Figure 1: Only two fields displayed in GridGroupingControl

Samples:

C#: RemoveFields_GGC_CS

VB: RemoveFields_GGC_VB

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

Live Chat Icon For mobile
Live Chat Icon