ComponentOne True DBGrid for WinForms
Data Presentation Techniques / Filtering Data in DataSets / Condition Filtering
In This Topic
    Condition Filtering
    In This Topic

    True DBGrid for WinForms now includes flexible conditional filtering similar to the FlexGrid for WinForms style of filtering.


    If you set the FilterBar property to False, and the FilterDropdown property to True, the C1TrueDBGrid control will allow using the new filters in the column.

    To write code in Visual Basic

    Visual Basic
    Copy Code
    ' Do not display the filter bar.
    Me.C1TrueDBGrid1.FilterBar = False
    ' Allow the first column to be filtered by multiple items.
    Me.C1TrueDBGrid1.Columns(1).FilterDropDown = True
    

    To write code in C#

    C#
    Copy Code
    // Do not display the filter bar.
    this.c1TrueDBGrid1.FilterBar = false; 
    // Allow the first column to be filtered by multiple items.
    this.c1TrueDBGrid1.Columns[1].FilterDropDown  = true;
    

    The data filtering feature follows the pattern used by C1FlexGrid. When users move the mouse over column headers, the grid displays a filter icon on the header. Clicking the icon invokes the filter editor which selects the data that should be displayed. Every column has a filter, and rows must pass all filters in order to be displayed.


    The built-in filters include the value filter, which allows users to select specific values for display, as well as a condition filter, which allows them to specify up to two conditions using operators such as "greater than", "starts with", or "contains". This type of filter is recommended for filtering columns that contain "continuous" values such as numeric or date/time values.


    Columns that have filters applied display the filter icon on their headers even when the mouse is not over them.


    See Also