Both of these requirements are possible:
2. The command item can be enabled from here and you probably have this set already in your app:
1. Now, for the first requirement, there are two options:
If the condition is depending on a database value - you can use the ItemDataBound event handler and access the isClosed value of the individual records:
Then, if it is true, you can access the command item using the GetItems method:
Finally, all you need to do is to use the commandItemInstance.FindControl("ID") method to access the buttons and toggle their visibility or enabled state:
- for refresh button: the ID is RefreshButton
- for insert button: the ID is AddNewRecordButton
If the condition is depending on the checkbox selection made by the user when the item is in edit mode, you can access the CheckBox control using ItemCreated event handler and enable its AutoPostBack property:
Then, you can hook on its change event and in the code behind you can use (sender as CheckBox).Checked to get the condition value. The rest of the process is analogous to the previous step.
I hope this will prove helpful.
Get quickly onboarded and successful
with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.