Intersoft WebDesktop Documentation
How-to: Obtain key state during DragDrop event
See Also Send Feedback
Intersoft WebDesktop > WebDragDropExtender > Features > Keyboard State > How-to: Obtain key state during DragDrop event

Glossary Item Box

You can obtain key state during DragDrop event.

This topic will show you how to obtain key state during DragDrop event.

To obtain key state during DragDrop event

  1. Click on WebDragDropExtender instance and press F4.
  2. On ClientSide >> OnDragDrop property, click the arrow icon and write DragDrop.
  3. On HTML mode create a new client side function and named it function DragDrop(controlId, e, dropObject). Here are the complete code :

    JavaScript Copy Code
    function DragDrop(controlId, e, dropObject)
    {
        var listBox = document.getElementById("listBox1");
        var op = document.createElement("option");
        var effectText = "";
        
        if (e.Effect == ISDragDropEffects.Copy)
            effectText = "Copied";
        else if (e.Effect == ISDragDropEffects.Move)
            effectText = "Moved";
        else if (e.Effect == ISDragDropEffects.Link)
            effectText = "Linked";
        else
            effectText = "[Default] Moved";
        
        op.text = effectText + " '" + e.Data + "' to '" + dropObject.Element.id + "'";
        listBox.options.add(op);
    }              

  4. Compile and run the project.

See Also

© 2012 Intersoft Solutions Corp. All Rights Reserved.