Hi Krailit,
Greetings from Syncfusion support.
Based on your query, you want to collapse only the
second grouped column in your grid. This can be achieved by using the `grid.groupModule.expandCollapseRows`
method in the dataBound event of the EJ2 Grid.
Please refer the below code example.
|
dataBound() {
if (this.initial) {
this.initial = false;
var groupedRecords = this.grid
.getContentTable()
.querySelectorAll('.e-recordplusexpand');
groupedRecords.forEach((item, index) => {
if (item.getAttribute('ej-mappingname') === 'Country') {
this.grid.groupModule.expandCollapseRows(item);
}
});
}
}
|
Sample: https://stackblitz.com/edit/angular-9e6tzs?file=app.component.ts
Please get back to us for further details.
Regards,
Joseph I.