procedure TForm1.Button1Click(Sender: TObject);
var
iFieldCnt : Integer;
I: Integer;
fItems : TcxCustomGridTableItem;
iRecCnt : Integer;
begin
iFieldCnt := Table1.FieldCount;
Try
cxGrid1TableView1.BeginUpdate;
cxGrid1TableView1.ClearItems;
for I := 0 to iFieldCnt - 1 do
begin
fItems := cxGrid1TableView1.CreateItem;
fItems.Name := cxGrid1TableView1.Name + Table1.Fields[i].FieldName;
if Table1.Fields[i].DataType in [ftGraphic, ftBlob, ftTypedBinary ] Then
begin
fItems.PropertiesClass := TcxImageProperties;
TcxImageProperties( fItems.Properties ).GraphicClass := TBitmap;
end;
fItems.Caption := Table1.Fields[i].FieldName;
end;
With Table1 do
begin
First;
while not Eof do
begin
Inc( iRecCnt );
cxGrid1TableView1.DataController.RecordCount := iRecCnt;
for I := 0 to iFieldCnt - 1 do
cxGrid1TableView1.DataController.Values[ iRecCnt - 1 , i ] := Fields[i].Value;
Next;
end;
end;
Finally
cxGrid1TableView1.EndUpdate;
End;
end;
'개발' 카테고리의 다른 글
[DELPHI] DEVEXPRESS UNBOUND 모드(DB 프로시저 이용) 연결 (0) | 2018.09.11 |
---|---|
[DELPHI] 데이터베이스 개발관련 요점 2 (0) | 2018.09.06 |
[DELPHI] 데이터베이스 개발관련 요점 1 (0) | 2018.09.06 |
[C#] DEVEXPRESS GANTT (1) | 2018.08.17 |
분리기통 2인용 고전게임기 자작 (0) | 2017.10.25 |