Synchronizing visual controls

Several data-aware controls can be associated with the same DataSet. In such cases, the controls navigate together and when you change the row position of a control, the row position changes for all controls that share the same cursor. This synchronization of controls that share a common DataSet can greatly ease the development of the user-interface portion of your application.

The DataSet manages a "pseudo" record, an area in memory where a newly inserted row or changes to the current row are temporarily stored. Controls which share the same DataSet as their data source share the same "pseudo" record. This allows updates to be visible as soon as entry at the field level is complete, such as when you navigate off the field.

You synchronize multiple visual controls by setting each of their dataSet properties to the same data set. When controls are linked to the same data set, they "navigate" together and will automatically stay synchronized to the same row of data. This is called shared cursors. For example, if you use a NavigatorControl and a GridControl in your program, and connect both to the same QueryDataSet, clicking the "Last" button of the NavigatorControl automatically displays the last record of the QueryDataSet in the GridControl as well. If those controls are set to different dataSet components, they do not reposition automatically to the same row of data.

The goToRow(borland.jbcl.dataset.ReadRow) method provides a way of synchronizing two DataSet components to the same row (the one that dataSet is on) even if different sort or filter criteria are in effect.