# Ag-Grid: Implementing Auto-Grouping Conditionally Based on Unique Column Values

**URL:** <https://community.plotly.com/t/ag-grid-implementing-auto-grouping-conditionally-based-on-unique-column-values/79527>\
**Category:** Dash Python\
**Created:** [October 21, 2023, 3:02pm UTC](https://community.plotly.com/t/ag-grid-implementing-auto-grouping-conditionally-based-on-unique-column-values/79527 "2023-10-21T15:02:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![davzup89](https://avatars.discourse-cdn.com/v4/letter/d/439d5e/32.png) [@davzup89](https://community.plotly.com/u/davzup89)\
**Post date:** [October 21, 2023, 3:02pm UTC](https://community.plotly.com/t/ag-grid-implementing-auto-grouping-conditionally-based-on-unique-column-values/79527/1 "2023-10-21T15:02:43Z")

</div>

Hi!

In my app I autogroup values as:

```auto
    dashGridOptions={
                        "groupDisplayType": "singleColumn",
                        "autoGroupColumnDef": {
                                "headerName": "Method",       
                                "minWidth":100,
                            }
                    }

```

This also creates a group where only one distinctive row of values exists. Does ag-grid offer a possibilty to group only if there is more than one distinctive row? I haven’t seen such case so far.

---

<div class="post-metadata">

**Author:** ![AnnMarieW](https://avatars.discourse-cdn.com/v4/letter/a/ec9cab/32.png) [@AnnMarieW](https://community.plotly.com/u/AnnMarieW)\
**Post date:** [October 21, 2023, 3:40pm UTC](https://community.plotly.com/t/ag-grid-implementing-auto-grouping-conditionally-based-on-unique-column-values/79527/2 "2023-10-21T15:40:19Z")

</div>

Have you checked the upstream docs for what you are looking for? We could provide a Dash example if needed: [React Data Grid: Row Grouping](https://www.ag-grid.com/archive/29.3.5/react-data-grid/grouping/)

---

<div class="post-metadata">

**Author:** ![davzup89](https://avatars.discourse-cdn.com/v4/letter/d/439d5e/32.png) [@davzup89](https://community.plotly.com/u/davzup89)\
**Post date:** [October 22, 2023, 8:56am UTC](https://community.plotly.com/t/ag-grid-implementing-auto-grouping-conditionally-based-on-unique-column-values/79527/3 "2023-10-22T08:56:43Z")

</div>

I solved it indirectly with:

```auto
"groupHideOpenParents": True

```

It is not a complete solution though because using this soltion together with custom agg functions can cause some (although minimal) grid flickering when adding new rows to the grid.
