Data.DB.TDataSource.OnStateChange

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type: event
Visibility: published
Source:
Data.DB.pas
Data.DB.hpp
Unit: Data.DB
Parent: TDataSource

Delphi

property OnStateChange: TNotifyEvent read FOnStateChange write FOnStateChange;

C++

__property System::Classes::TNotifyEvent OnStateChange = {read=FOnStateChange, write=FOnStateChange};

Description

Occurs when the state of the dataset of a data source component changes.

Write an OnStateChange event handler to take specific actions when the State property changes for a dataset associated with a data source component.

During the course of a normal connection to a database, the state of a dataset changes frequently. For example, each time a user starts editing a field in a data-aware control the State property of the dataset is changed from dsBrowse to dsEdit if the State is not already dsEdit. An OnStateChange event handler can respond to changes in state by taking actions such as disabling or enabling menu items or buttons.

See Also