Hi Dana Sarghe,
Greetings from Syncfusion.
By default, Checkbox selection is used for multiple Grid row
selection. So, if you want to maintain only one selected row at a time, You can
achieve your requirement by using the “rowSelecting” event of Grid
component. Please refer to the below code example, documentation link and
sample link.
[component.ts]
|
@Component({
selector: 'app-root',
templateUrl: ' <ejs-grid #grid
[dataSource]='data' allowPaging='true' [allowSelection]="true"
[editSettings]='editSettings' (rowSelecting)='rowSelecting($event)'>
<e-columns>
<e-column
type='checkbox' width='50'></e-column>
. . .
</e-columns>
</ejs-grid> ',
})
export class AppComponent {
. . .
rowSelecting(e){
if(this.grid.getSelectedRecords().length){
this.grid.clearSelection();
}
}
}
|
Documentation: https://ej2.syncfusion.com/angular/documentation/api/grid/#rowselecting
https://ej2.syncfusion.com/angular/documentation/api/grid/#getselectedrecords
https://ej2.syncfusion.com/angular/documentation/api/grid/#clearselection
Sample : https://stackblitz.com/edit/angular-z9wemm?file=app.component.html,app.component.ts
Please get back to us if you need further assistance.
Regards,
Pavithra S