CreateRecordsFromDropArray Method
Description
Creates a GridRecords collection object from a ByteArray.
Syntax
Public Function CreateRecordsFromDropArray( _
ByVal [ByteArray](#) As Variant _
) As [GridRecords](XtremeGridControl~GridRecords.md)
Parameters
- ByteArray: An array of bytes which represent a GridRecords collection object.
Return Type
Returns a GridRecords collection object containing records that were stored on the system clipboard.
Remarks
The CreateRecordsFromDropArray method is used when retrieving records that have been dragged from the Grid Control. CreateRecordsFromDropArray accepts the ByteArray returned from the Data.GetData parameter from any control's OLEDragDrop event and populates a GridRecords collection created by CreateRecords with the records stored on the clipboard.
Notes
-
CreateRecords is primarily used to create an empty GridRecords collection in Drag and Drop operations. The new GridRecords collection is used to create a collection of GridRecord objects to be dropped into the Grid Control or to retrieve records that have been dragged out of the Grid Control.
-
The DragRecords method is used to prepare records to be dropped into the Grid Control. DragRecords accepts a GridRecords collection created by CreateRecords. Any records that have been prepared using DragRecords will be added to the Grid when the items are dropped into the Grid Control. Typically, DragRecords would be used in the MouseMove event of the control from which items are being dragged. The Grid Control will automatically add the new records to the grid once they have been dropped.
-
To enable Drag and Drop in a Grid Control, the EnableDragDrop method must be used. EnableDragDrop does two things: first, it sets a clipboard string that will be used to indicate the type of data that is copied to the clipboard. Second, it sets the drag and drop effects that are allowed when dragging items to/from the Grid Control. The available effects are stored in the XTPGridDragDrop enumeration. If dragging items to/from one or more Grid Controls, the same clipboard string must be used for all Grid Controls when calling EnableDragDrop.
-
The BeginDrag event occurs when records are being dragged from the Grid Control and provides a GridRecords collection containing all of the selected records when the drag operation started. This gives the opportunity to modify the GridRecords collection before they are actually added to the clipboard.
-
The DropRecords event occurs when records are dropped into a Grid Control and provides a GridRecords collection containing all of the records that will be dropped into the Grid Control. This gives the opportunity to modify the GridRecords collection before they are actually added to the Grid Control.
See Also
- TrackControl Control
- CreateRecords Method
- DragRecords Method
- EnableDragDrop Method
- BeginDrag Event
- DropRecords Event
- XTPGridDragDrop Enumeration
Example
Copyright (c) 1998-2024 Codejock Technologies. All rights reserved.