Ticket T252167
Visible to All Users

Drag Drop viewcontroller

created 10 years ago

Dear support,

I am trying to build a win forms view controller that allows dropping and processing of outlook emails or files from the file system on a grid.

The way it will work is that as soon as the Mouse pointer is dragged on a grid view, the grid view is changed to masterdetailview ( This part is working well), and when the mouse pointer is dragged over the grid the focused row is changed to follow the dragged mousepointer. ( this part is not working correctly)

I have encountered a problem with the  gridView.CalcHitInfo(NewPoint(e.X, e.Y)) calculation inside the Dragover event handler. Its calculated row handle is higher than the row that the mouse pointer is dragged over.

Can you please review the attached viewcontroller and advise. nb the viewcontroller should work in any winforms project !

( Please note, when you review the code,  I also could not get the dragLeave event to fire, so I had to code around that with a timer to switch the master detail view back to list view )

Thanks for your help in advance.

Regards

Leo

Comments (1)

    I have done some more research,  and think the cause is the following :  The  coordinates passed to the dragdrop event are screen coordinates and not relative coordinates for the grid control.  calcinfo probably requires coordinates relative to the top left of the control.  I think I need to subtract the top left coordinate of the control from the screen coordinate before I call calchitinfo ???
    Please advise

    Answers approved by DevExpress Support

    created 10 years ago (modified 10 years ago)

    Dear support,

    Figured it out.

    gridView.CalcHitInfo(gridcontrol.PointToClient(NewPoint(e.X, e.Y)))

    Please ignore/ close support request.

    Regards

    Leo

      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.