MyDAC

TDALoader.OnGetColumnData Event

Occurs when it is needed to put column values.

Class

TDALoader

Syntax

property OnGetColumnData: TGetColumnDataEvent;

Remarks

Write the OnGetColumnData event handler to put column values. TDALoader calls the OnGetColumnData event handler for each column in the loop. Column points to a TDAColumn object that corresponds to the current loading column. Use its Name or Index property to identify what column is loading. The Row parameter indicates the current loading record. TDALoader increments the Row parameter when all the columns of the current record are loaded. The first row is 1. Set EOF to True to stop data loading. Fill the Value parameter by column values. To start loading call the Load method.

Another way to load data is using the OnPutData event.

Example

This handler loads 1000 rows.

procedure TfmMain.GetColumnData(Sender: TObject;
   Column: TDAColumn; Row: Integer; var Value: Variant;
   var EOF: Boolean);
begin
   if Row <= 1000 then begin
      case Column.Index of
         0: Value := Row;
         1: Value := Random(100);
         2: Value := Random*100;
         3: Value := 'abc01234567890123456789';
         4: Value := Date;
      else
         Value := Null;
      end;
   end
   else
      EOF := True;
end; 

See Also

© 1997-2024 Devart. All Rights Reserved. Request Support DAC Forum Provide Feedback