Hi Brian,
Thank you for contacting Syncfusion support.
We have achieved your requirement using data-bound event of Grid. In this event, we need to call collapseAll method for Collapse all the group caption rows in grid. Please refer to the below help documents and code example.
<ej-grid id="FlatGrid" allow-paging="true" allow-grouping="true" action-complete="actioncomplete" group-settings="@(new GroupSettings { GroupedColumns= new List<string>() { "EmployeeID" } })" databound="databound" datasource="ViewBag.dataSource">
<e-columns>
<e-column field="OrderID" header-text="Order ID"></e-column>
<e-column field="EmployeeID" header-text="Employee ID"></e-column>
<e-column field="CustomerID" header-text="Customer ID"></e-column>
<e-column field="ShipCountry" header-text="Ship Country"></e-column>
<e-column field="Freight" header-text="Freight"></e-column>
</e-columns>
</ej-grid>
</div>
<script type="text/javascript">
function databound(args) { // initial load
this.collapseAll();
}
</script> |
If you want to collapse all the group caption rows in grid while perform paging operation in Grid . We suggest you to use action-complete event of Grid. In this event we need to call collapseAll method when args.requestType as paging. Please refer to the below help document, code example and sample.
<ej-grid id="FlatGrid" allow-paging="true" allow-grouping="true" action-complete="actioncomplete" group-settings="@(new GroupSettings { GroupedColumns= new List<string>() { "EmployeeID" } })" databound="databound" datasource="ViewBag.dataSource">
<e-columns>
<e-column field="OrderID" header-text="Order ID"></e-column>
<e-column field="EmployeeID" header-text="Employee ID"></e-column>
<e-column field="CustomerID" header-text="Customer ID"></e-column>
<e-column field="ShipCountry" header-text="Ship Country"></e-column>
<e-column field="Freight" header-text="Freight"></e-column>
</e-columns>
</ej-grid>
</div>
<script type="text/javascript">
function databound(args) { // initial load
this.collapseAll();
}
function actioncomplete(args) {
if (args.requestType == "paging") { // paging
this.collapseAll();
}
}
</script> |
Regards,
Jayaprakash K.