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

Drag and drop with RadConfirm

3 Answers 68 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Peter Huisman
Top achievements
Rank 2
Peter Huisman asked on 03 Jul 2013, 08:12 AM
Hello,

Is there already a possible solution for using the RadConfirm with the drop of the treeview? I have used the rad dialogboxes trhoughout my application but now the client needs a check on a drop. According to previous posts this is only possible by using the browser confirm, but this is a break in style. Are there any examples how to do this with the ondrop?

3 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 05 Jul 2013, 02:02 PM
Hello,

Indeed you can implement such confirmation functionality using our RadConfrim dialog box and I have attached a sample project. I would like to clarify that the attached project supports multiple nodes selection and the drop position as well.

Hope that this will be helpful.

Regards,
Boyan Dimitrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Peter Huisman
Top achievements
Rank 2
answered on 11 Jul 2013, 09:35 AM
I noticed that I haven't given enough information. What I want to do is drag an item from treeview to image (trashcan). Behind the ondropped is a server side procedure that performs a delete. Because of the async, the procedure is fired no matter the answer in the dialog. I want the dialog to have the same effect as a javascript confirm.
0
Accepted
Boyan Dimitrov
Telerik team
answered on 16 Jul 2013, 08:19 AM
Hello,

Your observations are absolutely correct and your custom procedure will be fired no matter of the answer in the dialog. The Telerik RadWindow popups are non-blocking; that is, they do not block the execution thread on the server. This is because the execution of the thread cannot be blocked by Javascript.
In this case one possible workaround would be the approach shown in the attached project from my last response. You can simply subscribe for the RadTreeView OnClientNodeDropping client-side event and cancel the drop action by default but store in some global variable or hidden filed the node object prepared for delete.That way you will be able to delete that node explicitly from the callback function of the RadConfirm dialog box if the user has selected "Ok". If he has selected "Cancel" you don't need to do anything since you have already cancelled the node dropping. 

If you want to delete the node object on the server - you can simply execute an Ajax request using the RadAjaxManager and access the RadTreeView object on the server and perform the delete process. Here you may find  here more information about explicit AJAX requests to the server from the client.

Hope that this will be helpful.

Regards,
Boyan Dimitrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
TreeView
Asked by
Peter Huisman
Top achievements
Rank 2
Answers by
Boyan Dimitrov
Telerik team
Peter Huisman
Top achievements
Rank 2
Share this question
or