Hi Manolo,
Thanks for contacting Syncfusion support.
Query -1: I need cancel a selection if selected row doesn't meet some requirements, in my case. I only can select rows with same ProductoElectricidad.
Based on your query we suspect that you want to prevent the row selection if the selected row does not meet some requirements. So, we have prepared sample based on your code example but we did not face the reported issue at our end.
Please refer to the below code.
|
rowSelecting(args) {
const selected = this.grid.getSelectedRecords() as any;
//checked selected row’s ShipCountry data to the args data
const mismoProd = selected.every(x => x.ShipCountry === (args.data as any).ShipCountry)
if (mismoProd) {
this.productosSeleccionados.push(args.data);
} else {
args.cancel = true;
}
} |
Query -2: How can I hide the header check for check/uncheck all
We have achieved your requirement by defining display as none for required checkbox element in dataBound event. please refer to the below code.
|
dataBound(args){
(this.grid.getHeaderContent().getElementsByClassName('e-checkbox-wrapper')[0] as any).style.display = "none"
}
|
For more reference please refer to the below sample for both queries
If still facing the issue, please share below details then only we provide the appropriate solution as soon as possible.
1. Share issue reproducing sample or reproduce the issue in above provide sample.
2. Syncfusion package version.
3. If possible, share complete Grid code file.
4. Are you using any customized style or script in your application
Regards,
Thiyagu S