Back to Devexpress

TdxMemPersistent.Option Property

vcl-dxmdaset-dot-tdxmempersistent.md

latest2.0 KB
Original Source

TdxMemPersistent.Option Property

Specifies the automatic load mode for data stored in a DFM file.

Declaration

delphi
property Option: TdxMemPersistentOption read; write; default poActive;

Property Value

TypeDefaultDescription
TdxMemPersistentOptionpoActive

The active automatic data load mode.

|

Remarks

A TdxMemData component automatically loads data stored in a DFM file when you call the component’s Open procedure or set the Active property to True.

You can set the Option property to poNone or poLoad to populate the memory-based dataset with data stored in a DFM file on demand or at application startup, respectively.

Refer to the TdxMemPersistentOption type description for detailed information on all available options.

Code Example: Delete All Records

The following code example deletes all records stored in a memory-based dataset:

delphi
if dxMemData1.Persistent.Option = poActive then
    dxMemData1.Persistent.Option := poNone;
  dxMemData1.Close;
  dxMemData1.Open;
cpp
if(dxMemData1->Persistent->Option == poActive)
    dxMemData1->Persistent->Option = poNone;
  dxMemData1->Close();
  dxMemData1->Open();

Default Value

The Option property’s default value is poActive.

See Also

TdxMemPersistent.LoadData Procedure

TdxMemPersistent Class

TdxMemPersistent Members

dxmdaset Unit