Ticket T512585
Visible to All Users
Duplicate

We have closed this ticket because another page addresses its subject:

The WinExplorerView doesn't clear PressedInfo when a Drag&Drop operation begins

Reorder items in WinExplorerView by drag and drop

created 8 years ago

Hello,

I'd like to implement reorder by drag and drop in a WinExplorerView. Do you have a sample code, similar to what you provide for a GalleryControl in https://www.devexpress.com/Support/Center/Question/Details/Q306870

While dragging, I'd also like to show the drop location by drawing a vertical line, like in the screenshot attached.

Thank you

Answers approved by DevExpress Support

created 8 years ago (modified 8 years ago)

Hello,

Thank you for providing us with the screenshot.

From what I gather, your main goal is to implement the Drag&Drop mechanism within your WinExplorerView and also change the current cursor image while dragging. If so, you can implement this by using standard approaches, such as handling the MouseDownMouseMove and DragDrop events. We have numerous examples that illustrate how to implement Drag&Drop in our grid. See them here. In most of these examples, we use GridView. However, the logic will be the same for WinExplorerView.

To obtain the element which is located under the mouser pointer, use the WinExplorerView.CalcHitInfo method. To show an image during dragging an item, utilize the standard approach from the Control.GiveFeedback event MSDN help article.

Should you have additional questions, let us know.

See also:
GridControl - WinExplorer View (File Manager) walkthrough

    Show previous comments (3)
    DevExpress Support Team 8 years ago

      Hello,

      I've reproduced the problem and created the following bug report: The WinExplorerView doesn't clear PressedInfo when a Drag&Drop operation begins. Our developers will fix the issue as soon as possible.
      Meanwhile, you can overcome the problem by manually clearing WinExplorerViewInfo.PressedInfo in the WinExplorerView.MouseMove event handler before the GridControl.DoDragDrop method call as follows:

      C#
      (view.GetViewInfo() as WinExplorerViewInfo).PressedInfo = null;

      I've attached the updated project. Please review it.

        Thank you for the fix.

        DevExpress Support Team 8 years ago

          You're welcome!

          Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

          Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.