ComponentOne True DBGrid Pro 8
Tutorial 14 - OLE Drag-and-Drop

In this tutorial, you will learn how to use the OLE drag-and-drop features of True DBGrid. Unlike the Visual Basic drag-and-drop demonstrated in Tutorial 13, which invokes code as one control is dragged or dropped over another, OLE drag-and-drop moves data from a source component to a target component. These components can be controls on a Visual Basic form or standalone applications. For example, you can select a range of text in Word 97 or Access 97, then drop it into a True DBGrid control in your own application.

  1. Start a new project.

  2. Place a Data control (Data1), a True DBGrid control (TDBGrid1), and a TextBox control (Text1) on the form (Form1) as shown in the following figure.

  3. Set the DatabaseName property of Data1 to TDBGDemo.MDB, and the RecordSource property to Composer.

  4. Set the DataSource property of TDBGrid1 to Data1.

  5. Set the AllowAddNew and AllowDelete properties of TDBGrid1 to True (note that the default value of AllowUpdate is True).

  6. Set the MultiLine property of Text1 to True. Type several lines of text into the Text property of Text1.

  7. Set the OLEDragMode property of both TDBGrid1 and Text1 to 1 - Automatic, and the OLEDropMode property of both controls to 2 - Automatic.

Run the program and observe the following:

This concludes Tutorial 14.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback