RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TCustomGrid.BeginColumnDrag Method

Starts the dragging of a column in the grid.

Pascal
function BeginColumnDrag(var Origin: Integer; var Destination: Integer; const MousePt: TPoint): Boolean; dynamic;
C++
__fastcall Boolean BeginColumnDrag(int Origin, int Destination, const TPoint MousePt);

BeginColumnDrag is called automatically when the user clicks on a column to start dragging. It enables the grid to control whether the column can be repositioned and if so, which column. 

Origin is the index of the column to be moved. When BeginColumnDrag is called, this is the index of the column in which the mouse was clicked. TCustomGrid does not change this value. However, descendant classes can override this method to adjust which column can be moved. 

Destination is the index of where the column should move. When BeginColumnDrag is called, this is the same as Origin. TCustomGrid does not change this value because the mouse has not yet moved. Descendant classes can override this method to adjust the default destination of the column. 

MousePt is the coordinates of the mouse button when the user clicked. 

BeginColumnDrag returns true if the drag operation is permitted, false if the drag should be disallowed. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!