Ticket A461
Visible to All Users

How to implement drag-and-drop operations for TcxGrid

created 21 years ago (modified a year ago)

Description:
How can I reorder records or move them to another view using drag-and-drop?

Answer:

You need to manually modify the grid's data at the dataset or DataController level to accomplish this task. Handle the OnDragDrop, OnDragOver, and OnStartDrag to respond to drag-and-drop operations. Hit tests will help you determine the record under the mouse cursor.

The attached project illustrates a possible implementation of drag-and-drop.

See also:
How to obtain the Grid row at a given location on the screen
How to drag a cell's value to an external editor
Why does my custom DragObject not function?
How to allow an end-user to perform a drag and drop operation with a specific criteria

Show previous comments (4)
TB TB
Thomas Behrens 9 years ago

    Is it possible to add a sample for C++?
    And the user is only allowed to drag&drop a record which has specific data. So I need to check the record value.

    Thanks
    Thomas

    DevExpress Support Team 9 years ago

      Hello Thomas,

      I've created a separate ticket on your behalf (T414461: Add a C++ project to A461 KB article). It has been placed in our processing queue and will be answered shortly.

      DevExpress Support Team 9 years ago

        C++ sample.

        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.