Skip to main content

TcxDBNavigatorButtons.DoButtonClick(Integer) Method

Implements the appropriate functionality for each navigator button.

Declaration

procedure DoButtonClick(ADefaultIndex: Integer); override;

Parameters

Name Type
ADefaultIndex Integer

Remarks

The DoButtonClick method overrides the TcxCustomNavigatorButtons.DoButtonClick method implementation and provides default actions for db navigator buttons. This method is called after a navigator button has been clicked and you did not prohibit default click processing in an OnButtonClick event handler.

The ADefaultIndex parameter specifies the clicked button index within the Buttons collection. According to this index, the appropriate action should be executed.

In contrast to non-db navigator buttons, whose actions are defined by the IcxNavigator.DoAction interface method implementation, the TcxDBNavigatorButtons.DoButtonClick method provides default dataset-specific actions for each button, as described in the following table.

Button Name

Default Action

First

Moves to the first record in the dataset:

  • posts any changes to the active record

  • fetches the first record and makes it active

  • sets the dataset’s Bof property to True

PriorPage

Posts any changes to the active record and moves the active record backward by the number of records specified by the PageSize property.

Prior

Moves to the previous record in the dataset:

  • posts any changes to the active record

  • sets the dataset’s Bof and Eof properties to False

  • fetches the previous record and makes it active

  • sets the Bof property to True if the first record in the dataset has already been active

Next

Moves to the next record in the dataset:

  • posts any changes to the active record

  • sets the dataset’s Bof and Eof properties to False

  • fetches the next record and makes it active

  • sets the Eof property to True if the last record in the dataset has already been active

NextPage

Posts any changes to the active record and moves the active record forward by the number of records specified by the PageSize property.

Last

Moves to the last record in the dataset:

  • posts any changes to the active record

  • fetches the last record and makes it active

  • sets the dataset’s Eof property to True

Insert

Posts any changes to the active record and inserts a new, empty record into the dataset. The newly inserted record is posted according to the dataset type.

Append

Posts any changes to the active record and inserts a new, empty record into the dataset. The newly inserted record is posted according to the dataset type.

Delete

Deletes the active record and positions the dataset on the next record. If the deleted record was the last record in the dataset, the previous one becomes the current record.

Edit

Enables editing of data in the dataset. Retrieves the record, sets the dataset into edit state, and broadcasts the state change to associated controls.

Post

Writes the edited record to the data storage or to the internal change log depending on the dataset type. Sets the dataset state to browse state.

Cancel

Cancels all the unsaved modifications to the current record if those changes have not been posted yet. If the dataset is not in edit state, Cancel does nothing.

Refresh

Fetches latest data from the database to update the dataset’s view of data. Used to ensure that an application has the latest data from the database. Most datasets try to maintain the current record position when refreshing. However, it is not always possible. For example, the current record may have been deleted from the server by another user. Unidirectional datasets have no mechanism to locate the current record after refreshing and always move back to the first record.

SaveBookmark

Allocates a bookmark for the active record in the dataset. Establishing a bookmark for a record enables the dataset to return to that record.

GotoBookmark

Position the dataset on a bookmarked record.

Filter

Displays the Filter Builder dialog implemented by the TcxDBFilterControl. For more information on how to use this feature, see Runtime Filtering topic.

See Also