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;

原文地址:https://www.cnblogs.com/hnxxcxg/p/6479540.html