You can set effect programmatically based on current key state.
This topic will show you how to determine effect programmatically based on current key state.
To determine effect programmatically based on current key state
- Click on WebDragDropExtender instance and press F4.
- On ClientSide >> OnDragOver property, click the arrow icon and write DragOver.
- On HTML mode create a new client side function and named it function DragOver(controlId, e, dropObject). Here are the complete code :
JavaScript
Copy Codefunction DragOver(controlId, e, dropObject) { // provide the Effect based on key state during drag over if ((e.KeyState & ISKeyState.Ctrl) == ISKeyState.Ctrl) e.Effect = ISDragDropEffects.Copy; else if ((e.KeyState & ISKeyState.Alt) == ISKeyState.Alt) e.Effect = ISDragDropEffects.Link; else if ((e.KeyState & ISKeyState.Shift) == ISKeyState.Shift) e.Effect = ISDragDropEffects.Move; else e.Effect = ISDragDropEffects.None; } - Compile and run the project.