cxgrid动态创建列

cxgrid动态创建列

procedure TFrmRuleEdit.CreateCols;
var
Column: TcxGridDBColumn;
begin
cdsPowerPrj.First;
while not cdsPowerPrj.Eof do
begin
Column := viewPower.CreateColumn;
Column.Caption := cdsPowerPrj.FieldByName('description').Text;
Column.DataBinding.FieldName := cdsPowerPrj.FieldByName('powerName').Text;
Column.PropertiesClassName := 'TcxCheckBoxProperties';
Column.Width := 50;
cdsPowerPrj.Next;
end;
end;

posted @ 2017-02-28 16:36  delphi中间件  阅读(2095)  评论(0编辑  收藏  举报