Hi,
I'm using a modified version of the custom confirmation window described here.
It works very well but sometimes I need to cancel dataSource.sync for certain grids (I'm using the ASP.NET MVC server wrapper).
I tried to use the RequestStart event of the DataSource and do a e.preventDefault() but this does not works and the request reaches the server code.
Can you help me, please?
5 Answers, 1 is accepted
You can handle the dataBinding event of the grids and cancel it when necessary. Thus, the grids will not retrieve the data.
Regards,
Viktor Tachev
Telerik

Unfortunately this does not works for me.
I want to remove the row from the grid but block the request to the server (because I'll send all the grid rows with the post along with other fields).
If I handle the dataBinding event and cancel the delete, the row does not get removed from the grid because the event happens before dataSource.sync.
Handle the requestStart event seems the only viable option here but it does not cancel the server request.
In that case you can define a custom transport option and handle the data modifications manually.
Regards,
Viktor Tachev
Telerik

Thanks Victor but I've implemented a simpler (for me) solution:
I've added a custom "data-" attribute to the grids for which I want to cancel dataSource.sync. Then, I check for the presence of this attribute and skip the sync accordingly.
It may not be the most elegant solution, but it was a quick fix and works well ;-)
I am glad that you have the issue resolved. Thank you for sharing your approach with the community.
Regards,
Viktor Tachev
Telerik