我动态创建了一个cxgrid,但不能用,老大们帮忙看看
代码如下:
var
aView:TcxGridDBTableView;
begin
FCxGrid := tCxGrid.create(self);
FCxGrid.Parent := self;
FCxGrid.Visible := true;
FCxGrid.left := 100;
FCxGrid.Top := 100;
FCxGrid.Width := 200;
FCxGrid.height := 200;
aView := TcxGridDBTableView(FCxGrid.CreateView(TcxGridDBTableView));
// aview.
with aView do
begin
with createcolumn do
caption := 'abc';
showmessage(Columns[0].Caption);
DataController.DataSource := ds1;
(DataController as IcxCustomGridDataController).DeleteAllItems;
(DataController as IcxCustomGridDataController).CreateAllItems;
showmessage(Columns[0].Caption);
end;
可以用showmessage看到列名
但view没有显示出来,整个GRID都是灰的
项目中急需,在线等......老大们帮忙啊