Possible Issue with disabling grid toolbar buttons

Hi, please see the attached razor file.

The code aims to demonstrate the ability to disable buttons in a grids toolbar items. 

When I run this code, I find that default buttons (ie Add and Edit) are disabled), but any custom buttons are not - see the screen shot below



checking the dev tools for the page, there appears to be some differences in the script that is generated


Attachment: TestPage_2ffc47b9.zip

1 Reply 1 reply marked as answer

RS Renjith Singh Rajendran Syncfusion Team March 3, 2021 06:53 AM UTC

Hi Jeremy, 

Greetings from Syncfusion support. 

We suggest you to ensure to pass toolbar item id values(combination of Grid’s ID and toolbar value) as arguments for the method. Please refer the codes below, 

 
<SfGrid ... ID="GridID"> 
    ... 
</SfGrid> 

private async void SetButtonState(bool enabled){    //pass toolbar item ids as arguments for EnableToolbarItems method    await usersGrid.EnableToolbarItems(new List<string>() { "GridID_Add""GridID_Edit""GridID_Reset Password" }, isEnable: enabled);}

Query : I find that default buttons (ie Add and Edit) are disabled 
As you haven’t enabled Grid’s CRUD properties in the GridEditSettings, the Add and Edit have remained disabled. 

Please get back to us if you need further assistance. 

Regards, 
Renjith Singh Rajendran 


Marked as answer
Loader.
Up arrow icon