Hi lorryl,
Thanks for contacting Syncfusion support.
Query : I want to show delete button follow by condition, how to show or hide the delete button in the toolbar?.
Based on your reported information we have achieved your requirement using button click event. In this event we have hided/showed Delete toolbar button using below code. Please refer to the below code and sample link.
btnClick(){
(this.grid.toolbarModule as any).element.querySelectorAll('#Grid_delete')[0].style.display = 'none';
}
btnClick1(){
(this.grid.toolbarModule as any).element.querySelectorAll('#Grid_delete')[0].style.display = 'block';
} |
(Or ) if you want to enable/disable the toolbar items in Grid. We have already discuss about the above mentioned query in the following documentation link. Please refer it.
For reference:
btnClick(args){
this.grid.toolbarModule.enableItems(['Grid_delete'], false);
}
btnClick1(args){
this.grid.toolbarModule.enableItems(['Grid_delete'], true);
} |
Please get back to us, if you need any further assistance.
Regards,
Thiyagu S