|String||A string expression that specifies the column's filter.|
If the FilterType property is exFilter the Filter property indicates the list of values being included when filtering. The values are separated by '|' character. For instance if the Filter property is "CellA|CellB" the control includes only the items that have captions like: "CellA" or "CellB".
If the FilterType is exPattern the Filter property defines the list of patterns used in filtering (globbing). The list of patterns is separated by the '|' character. A pattern filter may contain the wild card characters like '?' for any single character, '*' for zero or more occurrences of any character, '#' for any digit character. The '|' character separates the options in the pattern. For instance: '1*|2*' specifies all items that start with '1' or '2'.
If the FilterType property is exDate, the Filter property should be of "[dateFrom] to [dateTo]" format, and it indicates that only items between a specified range of dates will be included. If the dateFrom value is missing, the control includes only the items before the dateTo date, if the dateTo value is missing, the control includes the items after the dateFrom date. If both dates ( dateFrom and dateTo ) are present, the control includes the items between this interval of dates. For instance, the "2/13/2004 to" includes all items after 2/13/2004 inclusive, or "2/13/2004 to Feb 14 2005" includes all items between 2/13/2004 and 2/14/2004.
If the FilterType property is exNumeric, the Filter property may include operators like <, <=, =, <>, >= or > and numbers to define rules to include numbers in the control's list. The Filter property should be of the following format "operator number [operator number ...]". For instance, the "> 10" indicates all numbers greater than 10. The "<>10 <> 20" filter indicates all numbers except 10 and 20. The "> 10 < 100" filter indicates all numbers greater than 10 and less than 100. The ">= 10 <= 100 <> 50" filter includes all numbers from 10 to 100 excepts 50. The "10" filter includes only 10 in the list. The "=10 =20" includes no items in the list because after control filters only 10 items, the second rule specifies only 20, and so we have no items. The Filter property may include unlimited rules. A rule is composed by an operator and a number. The rules are separated by space characters. The CustomFilter property has no effect of the FilterType property is exNumeric.
If the FilterType property is exCheck the Filter property may include "0" for unchecked items, and "1" for checked items. The CellState property specifies the state of the cell's checkbox. If the Filter property is empty, the filter is not applied to the column, when ApplyFilter method is called. The CustomFilter property has no effect of the FilterType property is exCheck.
If the FilterType property is exImage the Filter property indicates the list of icons (index of the icon being displayed) being filtered. The values are separated by '|' character. The CellImage property indicates the index of the icon being displayed in the cell. For instance, the '1|2' indicates that the filter includes the cells that display first or the second icon ( with the index 1 or 2 ). The drop down filter window displays the (All) item and the list of icons being displayed in the column. The CustomFilter property has no effect of the FilterType property is exImage.
The Filter property has no effect if the FilterType property is one of the followings: exAll, exBlanks and exNonBlanks
The ApplyFilter method should be called to update the control's content after changing the Filter or FilterType property. The ClearFilter method clears the Filter and the FilterType properties. Use the FilterInclude property to specify whether the child items should be included to the list when the user applies the filter. Use the FilterCriteria property to filter items using AND, OR or NOT operators between columns. The FilterForVisible property specifies whether the drop down portion of the control displays all the time a text-box editor to allow filtering items of the control.
The following VB sample filters "Child 1" and "Child 2" items:
With ComboBox1 With .Columns(0) .Filter = "Child 1|Child 2" .FilterType = exPattern End With .ApplyFilter End With
The following C++ sample filters "Child 1" and "Child 2" items:
CColumn column = m_combobox.GetColumns().GetItem(COleVariant(long(0))); column.SetFilter( "Child 1|Child 2" ); column.SetFilterType( 3 /*exPattern*/ ); m_combobox.ApplyFilter();
The following VB.NET sample filters "Child 1" and "Child 2" items:
With AxComboBox1 With .Columns(0) .Filter = "Child 1|Child 2" .FilterType = EXCOMBOBOXLib.FilterTypeEnum.exPattern End With .ApplyFilter() End With
The following C# sample filters "Child 1" and "Child 2" items:
axComboBox1.Columns.Filter = "Child 1|Child 2"; axComboBox1.Columns.FilterType = EXCOMBOBOXLib.FilterTypeEnum.exPattern; axComboBox1.ApplyFilter();
The following VFP sample filters "Child 1" and "Child 2" items:
With thisform.ComboBox1 With .Columns.Item(0) .Filter = "Child 1|Child 2" .FilterType = 3 && exPattern EndWith .ApplyFilter EndWith