DragDropManager events and KeyStates

2 posts, 0 answers
  1. Dmitry
    Dmitry avatar
    29 posts
    Member since:
    Apr 2011

    Posted 02 Jun 2014 Link to this post

    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?
  2. Polya
    Polya avatar
    267 posts

    Posted 03 Jun 2014 Link to this post

    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()
        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.

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