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

DragDropManager events and KeyStates

1 Answer 128 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Dmitry
Top achievements
Rank 1
Dmitry asked on 02 Jun 2014, 02:18 PM
As I can see during debug, Telerik.Windows.DragDrop.DragEventArgs has a private field eventArgs which has a field KeyStates. But since Telerik DragEventsArgs hide eventArgs I cannot access KeyStates property.
How am I supposed to figure out if any modifier keys were pressed at the moment of any DragDropManager's events?

1 Answer, 1 is accepted

Sort by
0
Polya
Telerik team
answered on 03 Jun 2014, 03:01 PM
Hello Dmitry,

In order to get the KeyStates we need to add handler to QueryContinueDrag. There the event arguments available are of type Telerik.Windows.DragDrop.QueryContinueDragEventArgs which contain the DragDropKeyStates desired. More information about the drag source events and how to hook to them can be found here.
You can try something like this in your code:
public MainWindow()
{
    InitializeComponent();
    DragDropManager.AddQueryContinueDragHandler(this.listBox, OnQueryContinueHandler);
}
 
private void OnQueryContinueHandler(object sender, Telerik.Windows.DragDrop.QueryContinueDragEventArgs e)
{
    if (e.KeyStates == DragDropKeyStates.ShiftKey)
    {
        //insert logic here.
    }
}

Hopefully this helps.

Regards,
Polya
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
DragAndDrop
Asked by
Dmitry
Top achievements
Rank 1
Answers by
Polya
Telerik team
Share this question
or