ComponentOne List 8.0 for ActiveX
ReBind Method (TDBCombo)

 

TDBCombo Reference> TDBCombo Methods> ReBind Method (TDBCombo)

ReBind Method (TDBCombo)

This method re-establishes the connection with the bound data source, causing the TDBList or TDBCombo control to perform the same operations that occur when you set the DataSource property at design time.

Syntax

object.ReBind

Arguments

None

Return Value

None

Remarks

Method applies to TDBList and TDBCombo controls.

If you have not modified the control columns at design time, then executing the ReBind method will reset the columns, headings, and other properties based on the current data source.

However, if you have altered the columns in any way at design time (even if you leave the DataField properties blank), then the control will assume that you wish to maintain the modified control layout and will not automatically reset the columns.

For an unbound control with its DataMode property set to 2 - Unbound Extended or 3 - Application, this method discards all data and fires the UnboundReadDataEx or ClassicRead event to refill the control with records from the unbound data source. After the control has finished refilling its cache, it fires the FirstRowChange event.

For backward compatibility with earlier versions, the semantics of the Refresh and ReBind methods are reversed in DataMode 1 - Unbound. The ReBind method attempts to restore the current and topmost rows, but the Refresh method does not.

Note: To force the control to reset the column bindings even if the columns were modified at design time, invoke the ClearFields method immediately before ReBind. Conversely, to cancel the control's automatic layout response and force the control to use the current column/field layout, invoke the HoldFields method immediately before ReBind.

The HoldFields method is especially useful in the unbound modes when you have specified the column layout in code and would like to keep it intact after a ReBind operation.

See Also

TDBList and TDBCombo Controls

 

 


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

Product Support Forum  |  Documentation Feedback