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

1. Filtering rows

Showing only rows that satisfy selected criteria

  • Setting filter


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

    "Filter"

    .
    The "Filter" row can be placed to any row part, usually in Head below Header.
    The initial filtering can be set in the "Filter" row, by setting its cell values in

    V

    and operators in

    Filter

    attribute.
    The "Filter" row by default filters Body row part, it can be changed by row

    FilterPart

    attribute, to filter other row 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 row. 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" row are merged together by operator AND by default (all filters must be passed to show the row).
    If the "Filter" row has set

    FilterAction

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

    FilterAction

    = 2, the row 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 rows, set their default row id(s) to cell

    FilterD

    . Rows with other default rows 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

    , row

    CaseSensitive

    ), diacritics (Cfg

    FilterLocaleCompare

    , row

    LocaleCompare

    ), some characters (usually spaces) (Cfg

    FilterWhiteChars

    , row

    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 rows with empty cells in filtered columns by number operators set appropriate value to Cfg

    FilterIgnoreEmpty

    .
  • Filter restrictions


    To not filter the row, set row

    NoFilterRow

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

    NoFilterBy

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