ComponentOne True DBGrid Pro 8
DataMode Property

DataMode Property

Specifies bound or unbound mode.

Syntax

object.DataMode= value

Values

Design Time

Run Time

0 - Bound (default)

dbgBound

1 - Unbound

dbgUnbound

2 - Unbound Extended

dbgUnboundEx

3 - Application

dbgUnboundAp

4 - Storage

dbgUnboundSt

Remarks

Read-only at run time. Read/Write at design time.

When set to 0 - Bound, the control displays data available from its bound DataSource.

When set to 1 - Unbound, the control uses the original DBGrid unbound events to retrieve and update displayed data. When this mode is used, the grid fires the UnboundReadData event to fetch data. This setting was retained for backward compatibility with DBGrid and earlier versions of True DBGrid. If you are writing a new application, please use mode 2, 3, or 4 instead.

When set to 2 - Unbound Extended, the control uses the UnboundReadDataEx event to fetch data. The UnboundReadDataEx event is more efficient and easier to use than the UnboundReadData event of mode 1. This is the recommended setting for using the grid unbound with a database API that supports multiple-row fetches.

When set to 3 - Application, the control uses the ClassicRead event to fetch data one cell at a time. This mode is much easier to use than mode 2, particularly if data is being retrieved from a Visual Basic array. However, it can be less efficient than mode 2 if there are many columns because the grid needs to fire more events in order to retrieve data.

When set to 4 - Storage, the control uses an XArrayDB object as a data source, and no unbound data retrieval or update events are fired. At run time, you create and populate an XArrayDB object just as you would a standard Visual Basic array, then bind it to a TDBGrid or TDBDropDown control using the Array property. This is by far the simplest way to use True DBGrid in unbound mode.

See Also

TDBGrid Control

TDBDropDown Control

 

 


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

Product Support Forum  |  Documentation Feedback