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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Editable Grid - How to...
Power Apps
Answered

Editable Grid - How to setFilterXml on subgrids

(0) ShareShare
ReportReport
Posted on by 311

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?

I have the same question (0)
  • cchannon Profile Picture
    4,702 Moderator on at

    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.

  • Verified answer
    Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

    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 at

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

  • Rkaur Profile Picture
    84 on at

    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.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard