Version

Applying Enhanced Filter Condition to WinGrid at Run Time

Sometimes, there may be a need to apply a filter condition at run time on any specific UltraGridColumn , so that you can control the Filtered rows that are displayed to the end-user.

The following code assumes WinGrid™ is bound to the Northwind Orders table. The following code filters all rows where the RequiredDate column values fall within the month of January.

In Visual Basic:

Me.ultraGrid1.DisplayLayout.Bands(0).ColumnFilters("RequiredDate").FilterConditions.Add
                (Infragistics.Win.UltraWinGrid.FilterComparisionOperator.Equals, Infragistics.Win.UltraWinGrid.SpecialFilterOperands.January)

In C#:

this.ultraGrid1.DisplayLayout.Bands[0].ColumnFilters[“RequiredDate”].FilterConditions.Add
                (Infragistics.Win.UltraWinGrid.FilterComparisionOperator.Equals, Infragistics.Win.UltraWinGrid.SpecialFilterOperands.January);

Modifying DateTime Tree Appearance

The Appearance of the Tree in DateTime Object can be modified using the DateHierarchyLevel property. This property allows you to define the granularity of how specific you want to break down Dates for filtering (e.g., Year-> Month ->Day->Hour->Minute->Second).

In Visual Basic:

'Displays the DateTime object's tree level down to the Second.
Me.ultraGridFilterUIProvider1.TreeSettings.DateHierarchyLevel = DateHierarchyLevel.Second

In C#:

//Displays the DateTime object's tree level down to the Second.
 this.ultraGridFilterUIProvider1.TreeSettings.DateHierarchyLevel = DateHierarchyLevel.Second;