FilterText Property
Description
The FilterText property is used to filter the rows in the Grid Control by one or more text strings.
Property Type
Read-write property
Syntax (Visual Basic)
Public Property FilterText() As String
Remarks
The FilterText property is used to hold a string that is used to filter the rows in the Grid control. Only the rows that have RecordItems with a Caption that contains the text stored in FilterText will be displayed.
Placing a space between words in the filter string will cause the rows to be filtered by multiple strings. Each RecordItem in a row will be searched for each word in the filter string individually. The filter string is not case sensitive, and the order in which the words appear in the filter string does not matter.
For example, if the filter string is "Dog cat bird HORSE", only rows that contain any combination of the words "dog," "cat," "bird," and "horse" would be displayed. The order and case do not matter.
The PopulatedRecordsCount property will return the total number of records currently in the grid after a filter string is applied.
Example
FilterText Sample (Visual Basic)
This sample illustrates how to use the FilterText property to filter the rows shown in the Grid Control with a filter string. This sample assumes that there is a text box named txtFilter.
' On KeyUp update Grid control
Private Sub txtFilter_KeyUp(KeyCode As Integer, Shift As Integer)
' Filters the Grid control with the text in the TextBox control.
frmGridControl.wndGridControl.FilterText = txtFilter.Text
' Update Grid control
frmGridControl.wndGridControl.Populate
End Sub
See Also
- GridControl Control
- PopulatedRecordsCount Property
- FilterHiddenColumns Property
- FilterSeparatorStrict Property
Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.