Version

Enabling Enhanced Filtering on WinGrid

WinGrid™ offers Enhanced filtering as a means of controlling what data is displayed by the end-user. This functionality includes filtering by specific data-types, such as string operations (begins-with, contains, etc), date operations (between dates, before today’s date, etc), or providing the ability to filter by selecting multiple values that appear in a column using a checkbox.

In order to enable the advanced filtering UI on the WinGrid control that mimics the functionality provided by Excel2007, the following three steps need to be performed.

  1. Drag and drop the ultraGridFilterUIProvider™ component from the Visual Studio® toolbox on to your Form.

  2. Set the WinGrid control’s FilterUIProvider property to the ultraGridFilterUIProvider you placed on the Form.

In Visual Basic:

Me.ultraGrid1.DisplayLayout.Override.FilterUIProvider = Me.ultraGridFilterUIProvider1
'This can be set for each Band as well:
'Me.ultraGrid1.DisplayLayout.Bands(0).Override.FilterUIProvider = Me.ultraGridFilterUIProvider1

In C#:

this.ultraGrid1.DisplayLayout.Override.FilterUIProvider = this.ultraGridFilterUIProvider1;
//This can be set on each Band as well:
//this.ultraGrid1.DisplayLayout.Override.FilterUIProvider = this.ultraGridFilterUIProvider1;
  1. Set the AllowRowFiltering property to true.

In Visual Basic:

Me.ultraGrid1.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.True

In C#:

this.ultraGrid1.DisplayLayout.Override.AllowRowFiltering = Infragistics.Win.DefaultableBoolean.True;

Now data in the WinGrid can be filtered using the advanced Filtering options:

The following screenshot shows a WinGrid populated with the Orders table of the Northwind database. A text filter for the CustomerID column is shown below. You can filter by selecting the checkboxes or by selecting from the context menu and then entering a filter criterion. Pressing the Ok button will filter the Grid rows.

Filtering the ‘Text’ Data type(CustomerID) column

Wingrid Excel Style Filtering 1.png

Filtering the ‘Number’ Data type (EmployeeID) column

Wingrid Excel Style Filtering 2.png

Filtering the ‘Date’ Data-type (Order Date) column

Wingrid Excel Style Filtering 3.png

Related Topics