web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : fO2U1q4H333RqPIRnqRic2
Power Apps - Power Apps Pro Dev & ISV
Answered

Editable Grid - How to setFilterXml on subgrids

Like (0) ShareShare
ReportReport
Posted on 6 Oct 2023 19:10:04 by 306

With read-only grids in a model-driven app, we're able to change the filter XML for the grid from Javascript using the setFilterXml() function.  With a two-tier Editable grids, this appears to still work for the parent grid data. 

 

let gridContext= formContext.getControl("grid_StateTotals");

gridContext.setFilterXml(newFetchXML);

 

But how do I filter the records on the child grids (subgrids)?  Is there a way to access the individual subgrids to set the filter XML?

  • Rkaur Profile Picture
    84 on 04 Mar 2024 at 12:00:21
    Re: Editable Grid - How to setFilterXml on subgrids

    Hello,

     

    Have you find any alternate to this function in order to filter the subgrid dynamically ?

    We do not want to use side pane option, as the purpose is different. Not to create or modify records but to select a record from a filtered lookup on this subgrid.

    gridcontrol.setfilterXml(fetchXml);

    is not helping to filter by the passed fetchXML.

     

    Any alternate api method, kindly suggest ? How to achieve this requirement

     

    Thanks.

  • cchannon Profile Picture
    4,702 Moderator on 23 Oct 2023 at 20:14:48
    Re: Editable Grid - How to setFilterXml on subgrids

    @tschopp did @DianaBirkelbach's post help resolve your issue? Please come back and mark the solution so future visitors will see!

  • Verified answer
    Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on 09 Oct 2023 at 18:20:17
    Re: Editable Grid - How to setFilterXml on subgrids

    Hi @tschopp , 

     

    Setting a custom/dynamic filterXml to a grid is the feature I'm missing the most.

    Actually the setFilterXml you are using, is unsupported too.

    As you say, we have even less control over the nested grids.

     

    If the OOB feature doesn't help, maybe it helps to use the SidePanes for side-by-side editing instead of nested grids... (on select on the grid, open a form with a subgrid on the side-pane,  like in this blog: https://dianabirkelbach.wordpress.com/2023/08/05/edit-subgrids-side-by-side-with-power-apps-grid-or-editable-grid/)

    But it could be a Custom Page on the SidePane.

     

    Hope this helps!

  • cchannon Profile Picture
    4,702 Moderator on 08 Oct 2023 at 16:57:58
    Re: Editable Grid - How to setFilterXml on subgrids

    The modern Editable Grid is almost infinitely customizable now because its source is bundled with specific namespaces for customization and freely available for any developer to extend:

     

    Customize the editable grid control - Power Apps | Microsoft Learn

     

    That said, there are definitely safe and less safe things you might do in customizing the Editable Grid, and once you start pushing unmanaged customizations to it, it's your problem to own so do so carefully, and only if you already have a firm understanding of working with PCFs.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete