News in versions: FastGrid 1.0, TreeGrid 17.0
FastGrid FastSheet ExamplesSamples DocumentationDoc Download Licensing Prices Buy Development
services
References References Contacts
TreeGrid Gantt chart SpreadSheet ExamplesSamples DocumentationDoc Download Licensing Prices Buy Contacts

2. Filtering columns

Showing only columns that satisfy selected criteria

  • Setting filter


    FastGrid filter can be set and controlled by special table column D:

    "Filter"

    .
    The "Filter" column can be placed to any column part, usually in LeftCols.
    The initial filtering can be set in the "Filter" column, by setting its cell values in

    V

    and operators in

    Filter

    attribute.
    The "Filter" column by default filters Cols column part, it can be changed by column

    FilterPart

    attribute, to filter other column part(s).
  • Changing filter


    Filter can be changed by a user by choosing filter operator from filter menu. It is possible to preset the available filter operators for given Filter cell by

    FilterMenu

    attribute.
    The filter can be changed also by changing cell value in the Filter column. If there was no filter operator, the value change presets also filter operator to operator set by cell

    DefaultFilter

    .
    The filter can be changed also by API method ChangeFilter.
  • Merging and disabling filters


    The individual filters in one "Filter" column are merged together by operator AND by default (all filters must be passed to show the column).
    If the "Filter" column has set

    FilterAction

    = 2, the individual filters are merged by operator OR (at least one filter must be passes to show the column).
    To disable filtering by the "Filter" column, set its FilterAction to 0.
    There can be more "Filter" columns in grid. The filters in these columns are merged together by operator AND by default.
    If the Cfg attribute

    FilterAction

    = 2, the column filters are merged by operator OR.
    To disable all filters in grid set Cfg attribute FilterAction to 0.
    Merging custom filters is controlled by Cfg

    FilterActionCustom

    .
  • Filter operators


    There are 15 filter operators that can be assigned to Filter attribute as numbers 0 - 14:
    Off:0 - Off
    Number filter:1 - Equal, 2 - Not equal, 3 - Less than, 4 - Less than or equal, 5 - Greater than, 6 - Greater than or equal
    String filter:7 - Begins with, 8 - Does not begin with, 9 - Ends with, 10 - Does not end with, 11 - Contains, 12 - Does not contain
    Range filter:13 - Equal all, 14 - Not equal all
  • Range filter


    To permit filtering by more selected values or by range(s) of dates or numbers set Filter cell attribute

    Range

    = 1.
    To permit filtering by comparing individual values in Range cells, set Filter cell attribute Range = 2.
  • Custom filters


    It is possible to add custom filters by API method

    SetFilter

    .
    Or set specific custom filter to filter range of values by API method

    FilterRange

    .
  • Wildcards


    In string filter is possible to use wildcards, "?" to replace one character (defined by Cfg

    FilterReplaceOne

    ), "*" to replace none, one or more characters (defined by Cfg

    FilterReplaceMore

    ).
  • Filter only specified defaults


    It is possible to apply the filter set in the Filter cell to only particular columns, set their default column id(s) to cell

    FilterD

    . Rows with other default columns will not be affected by this filter and will be always shown.
    To let users to choose the FilterD, define cell attribute

    FilterDList

    to add these options to the filter operators menu.
  • Filter settings


    Some of the global filter setting can be changed by users in popup menu for Tool cell D:

    Filter

    .
    When comparing values for filter it is possible to ignore case (Cfg

    FilterCaseSensitive

    , column

    CaseSensitive

    ), diacritics (Cfg

    FilterLocaleCompare

    , column

    LocaleCompare

    ), some characters (usually spaces) (Cfg

    FilterWhiteChars

    , column

    WhiteChars

    ), etc.
    To change the way the cell values are compared, set cell attribute

    FilterValue

    to use this value instead of the cell value for comparing.
    List values are filtered by List values by default, to filter by the index or keys set filter cell

    FilterRaw

    attribute.
    To hide columns with empty cells in filtered columns by number operators set appropriate value to Cfg

    FilterIgnoreEmpty

    .
  • Filter restrictions


    To not filter the column, set column

    NoFilterCol

    attribute.
    To not permit filtering by some cell in filter column, set its attribute

    NoFilterBy

    = 0 and optionally attributes NoEdit = 1 and LeftIcons = "".