D365 Finance & Operations and Dynamics AX Forum

Expand all | Collapse all

Clearing grid filters

  • 1.  Clearing grid filters

    TOP CONTRIBUTOR
    Posted 7 days ago
    ​Our users have asked for a "Clear filter" button on a custom form that clears the entries in the top part of the form and also clears the filters in the grid.  I'm able to clear the filters in the dropdown boxes at the top of the form, but how do I clear the column filters in the grid?

    Clear filters


    ------------------------------
    Rudy Salcedo
    Senior Programmer/Analyst
    LaForce, Inc
    Green Bay WI
    ------------------------------


  • 2.  RE: Clearing grid filters

    SILVER CONTRIBUTOR
    Posted 7 days ago
    Have you tried calling the mycontrol.filter("") method on each control of you grid?  You might also need to call yourDataSource.research() to refresh the grid after.

    ------------------------------
    Steeve Gilbert
    Software Development Supervisor
    Boa-Franc S.E.N.C.
    QC, Canada
    ------------------------------



  • 3.  RE: Clearing grid filters

    TOP CONTRIBUTOR
    Posted 6 days ago
    Could you do something like this?

    [Control("Button")]
    class ClearFiltersButton
    {
        public void clicked()
        {
        FormDataSource ds = this.formRun().dataSource("DataSourceName") as FormDataSource;
        ds.sortClear();
        ds.clearRanges();
        }
    }

    ------------------------------
    Alex Meyer
    Director of Dynamics AX/365 for Finance & Operations Development
    Fastpath
    Des Moines, IA
    ------------------------------



If you've found this thread useful, dive deeper into User Group community content by role