I have a delete button in my gridview, but I want this button not to work depending on the result of an sql query.
An example
I have a gridview with “ship containers”, and I want to remove one of the container from this list, but I want to display a message “to be able to delete this container, please remove it from the products”, so that if a ship container is in use, I need to prevent it from being deleted.
Here is the way you can do this:
Take notice on AllowDocDelete function that disables delete button. This function should be declared inslide your page class, something like this:
Item object represents binded entity.