Controls Suite 4.5
Populating with Data
Appearance & Layout
In conjunction with filter feature, Grid displays special button/indicator in the bottom bar. This element is useful to reflect the current filter state. It also can be used to switch ON/OFF applied row filter. For instance, when a row filter is applied, the filter indicator is marked as active. Likewise, when the filter is removed, the indicator is disabled (inactive).
You can use the following methods and properties to add/remove row filter.
Row Filter is a string expression that specifies how rows are to be filtered. For complete info about filter expressions, refer to the MSDN Library (the DataColumn.Expression property).
- The RowFilter is a server-side property which specifies the filter expression.
- The dg.SetRowFilter(GridID,Filter) is a client-side method which sets the filter.
- The dg.RemoveRowFilter(GridID) is a client-side method which removes the filter.
- The dg.GetRowFilter(GridID) is a client-side method which returns the filter.
- The dg.AddRowFilter(GridID,Filter) is a client-side method which adds a filter expression to the current Grid's filter expression.
Below are examples of the most popular filter expressions (C#):
dg1.RowFilter = "CustomerID = 'ANTON'";
dg1.RowFilter = "CustomerID Like 'A%'";
dg1.RowFilter = "Date = #12/31/2008#";
dg1.RowFilter = "Date < #1/1/2008#";
dg1.RowFilter = "City <> 'Tokyo' AND City <> 'Paris'";
dg1.RowFilter = "Age < 16 OR Age > 65 ";
To apply a filter which is switched off by default, use the "minus" sign at the first position:
dg1.RowFilter = "-CustomerID Like 'A%'";