ComponentOne True DBGrid Pro 8
DataSourceChanged Event

 

Object Reference> True DBGrid Events> DataSourceChanged Event

DataSourceChanged Event

The DataSourceChanged event occurs when a bound data source is changed or requeried. This event also fires when a bound grid control is first loaded.

Syntax

object_DataSourceChanged ( )

Arguments

None

Remarks

The DataSourceChanged event fires before the grid is filled with data. Therefore, you can use this event to initialize the grid according to information obtained from the data source, if necessary.

This event does not fire in unbound or storage modes.

Note

With the OLE DB version of True DBGrid, you can use the DataSourceChanged event in conjunction with the BookmarkType property to circumvent type mismatch errors that may occur when a grid-supplied bookmark is passed to an ADO Recordset object (or vice versa). The workaround is as follows:

Sub TDBGrid1_DataSourceChanged()

    TDBGrid1.BookmarkType = VarType(ADODC1.Recordset.Bookmark)

End Sub

This code ensures that any bookmarks returned by the grid are first converted to the appropriate type for the bound data source. This workaround is only needed when using the grid in an HTML page; it is not needed for Visual Basic 6.0.

See Also

TDBGrid Control

TDBDropDown Control

 

 


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

Product Support Forum  |  Documentation Feedback