This is a migrated thread and some comments may be shown as answers.

Cancelling automatic delete

1 Answer 51 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Stefan
Top achievements
Rank 1
Stefan asked on 23 Feb 2009, 10:01 AM
Hi,

we are using automatic actions in RadGrid for inserting, updating and deleting.
In examples an e.exception is checked after trying to get the id of the changed/deleted item.
If this exception is there an error message is shown and the operation was canceled.

Now this is our intended behaviour too - but with another check. Additionally i have to check against a database if it is allowed to delete this record. So i put some lines of code to ItemDeleted event.
My problem is that i have no event/method/exception for canceling the deleting of my database check results in false.
If i throw an exception and catch them at the end the event was fine and deletion was processed.

Is there any other possibililty to do this without setting automaticactions to false and write my own code?
Simply by setting a property to cancel delete or update?

Thanks in advance for clarify my issue.
Regards
Stefan

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 25 Feb 2009, 11:29 AM
Hello Stefan,

One possible option in this case would be to move the logic in the ItemCommand event handler. This is cancelable - there, you can check the value against the database, and cancel out the event if necessary.
I hope this suggestion helps.

All the best,
Yavor
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Stefan
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or