Drag and drop with RadConfirm

4 posts, 1 answers
  1. Peter Huisman
    Peter Huisman avatar
    16 posts
    Member since:
    Dec 2004

    Posted 03 Jul 2013 Link to this post

    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?
  2. Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 05 Jul 2013 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Peter Huisman
    Peter Huisman avatar
    16 posts
    Member since:
    Dec 2004

    Posted 11 Jul 2013 Link to this post

    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.
  5. Answer
    Boyan Dimitrov
    Admin
    Boyan Dimitrov avatar
    1746 posts

    Posted 16 Jul 2013 Link to this post

    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.
Back to Top