Vcl.DBCtrls.TDBNavigator

From RAD Studio API Documentation
Jump to: navigation, search

Vcl.Buttons.TBaseNavigatorVcl.ExtCtrls.TCustomPanelVcl.Controls.TCustomControlVcl.Controls.TWinControlVcl.Controls.TControlSystem.Classes.TComponentSystem.Classes.TPersistentSystem.TObjectTDBNavigator

Delphi

TDBNavigator = class (TBaseNavigator)

C++

class PASCALIMPLEMENTATION TDBNavigator : public Vcl::Buttons::TBaseNavigator

Properties

Type Visibility Source Unit Parent
class public
Vcl.DBCtrls.pas
Vcl.DBCtrls.hpp
Vcl.DBCtrls Vcl.DBCtrls

Description

TDBNavigator (the database navigator) is used to move through the data in a dataset and perform operations on the data, such as inserting a blank record or posting a record.

Use the database navigator on forms that contain data-aware controls, such as TDBGrid or TDBEdit. TDBNavigator lets the user control the dataset when editing or viewing the data.

When the user chooses one of the navigator buttons, the appropriate action occurs on the dataset to which the navigator is linked. For example, if the user clicks the Insert button, a blank record is inserted in the dataset.

TDBNavigator can show any or all of the following buttons:


Button Purpose

First

Sets the current record to the first record in the dataset, disables the First and Prior buttons, and enables the Next and Last buttons if they are disabled.

Prior

Sets the current record to the previous record and enables the Last and Next buttons if they are disabled.

Next

Sets the current record to the next record and enables the First and Prior buttons if they are disabled.

Last

Sets the current record to the last record in the dataset, disables the Last and Next buttons, and enables the First and Prior buttons if they are disabled.

Insert

Inserts a new record before the current record and sets the dataset into Insert and Edit states.

Delete

Deletes the current record and makes the next record the current record.

Edit

Puts the dataset into Edit state so that the current record can be modified.

Post

Writes changes in the current record to the database.

Cancel

Cancels edits to the current record, restores the record display to its condition prior to editing, and turns off Insert and Edit states if they are active.

Refresh

Refreshes the buffered data in the associated dataset.

ApplyUpdates

Writes changes for all the changed records (inserted, deleted or edited) to the database.

CancelUpdates

Cancels edits for all edited records, restores the record display to its condition prior to editing, and turns off Insert and Edit.


Note: To use ApplyUpdates and CancelUpdates you must enable them by changing the VisibleButtons property from Object Inspector pane.

See Also

Code Examples