Студопедия
Случайная страница | ТОМ-1 | ТОМ-2 | ТОМ-3
АвтомобилиАстрономияБиологияГеографияДом и садДругие языкиДругоеИнформатика
ИсторияКультураЛитератураЛогикаМатематикаМедицинаМеталлургияМеханика
ОбразованиеОхрана трудаПедагогикаПолитикаПравоПсихологияРелигияРиторика
СоциологияСпортСтроительствоТехнологияТуризмФизикаФилософияФинансы
ХимияЧерчениеЭкологияЭкономикаЭлектроника

Using TDataSource events

Читайте также:
  1. A clutch centre holding tool can easily be made using two strips of steel bent over at the ends and bolted together in the middle
  2. A few common expressions are enough for most telephone conversations. Practice these telephone expressions by completing the following dialogues using the words listed below.
  3. A) Historical facts and events which were not known to the Prophet (pbuh) or his contemporaries e.g. about Zulqarnain, city of Ihram etc.
  4. A. Rewrite the sentences without using the underlined words. Keep the meaning the same.
  5. A. Use the count nouns denoting EVENTS.
  6. Act as Sally. Answer the questions using the conversational formulas trained.
  7. Agree or disagree with the statements using the following

Lecture 7. Using TDataSource

 

TDataSource acts as a conduit between datasets and data-aware controls. Often the onlything you will do with a TDataSource component is to set its DataSet property to an appropriate dataset object. Then you will set data controls’ DataSource property to the specific TDataSource. You also use TDataSource components to link datasets to reflect master-detail relationships.

 

Using TDataSource properties

TDataSource has only a few published properties in addition to the standard Name and Tag properties.

The DataSet property

The DataSet property specifies the name of the dataset from which the TDataSource will get its data. You can also set the DataSet property to a dataset on another form to synchronize the data controls on the two forms. For example,

procedure TForm2.FormCreate (Sender: TObject); begin

DataSource1.Dataset:= Form1.Table1; end;

The Enabled property

The Enabled property can temporarily disconnect a TDataSource from its TDataSet. When set to False, all data controls attached to the data source will go blank and become inactive until Enabled is set to True.

In general, it is recommended to use datasets’ DisableControls and EnableControls methods to perform this function, because they affect all attached data sources.

 

The AutoEdit property

The AutoEdit property of TDataSource specifies whether datasets connected to the data source automatically enter Edit state when the user starts typing in data-aware controls linked to the dataset. If AutoEdit is True (the default), Delphi automatically puts the dataset in Edit state when a user types in a linked data-aware control. Otherwise, a dataset enters Edit state only when the application explicitly calls its Edit method

 

Using TDataSource events

TDataSource has three events associated with it:

OnDataChange

OnStateChange

OnUpdateData


Дата добавления: 2015-10-23; просмотров: 126 | Нарушение авторских прав


Читайте в этой же книге: Lecture 9. Using Data Controls | Defining a calculated field | KRS 0000234069, Regon 300055546, NIP 6080024482 |
<== предыдущая страница | следующая страница ==>
Searching a table| Using TFields and the Fields Editor

mybiblioteka.su - 2015-2024 год. (0.005 сек.)