第一个问题应该可以用自绘方式解决
用如下代码可以
procedure TForm1.cxGrid1BandedTableView1CustomDrawBandHeader(
Sender: TcxGridBandedTableView; ACanvas: TcxCanvas;
AViewInfo: TcxGridBandHeaderViewInfo; var ADone: Boolean);
var
r,r1:trect;
begin
r:=AViewInfo.Bounds;
r1:=r;
r1.Top:=r.Top-5;
ACanvas.FillRect(r1);
ACanvas.Pen.Color:=rgb(0,0,0);
ACanvas.MoveTo(r.Left,r.Top);
ACanvas.LineTo(r.Right-1,r.Top);
ACanvas.LineTo(r.Right-1,r.Bottom);
if AViewInfo.Band.Caption='工资' then
begin
ACanvas.DrawTexT('',R,0);
ADone:=TRUE;
end;
end;
procedure TForm1.cxGrid1BandedTableView1CustomDrawColumnHeader(
Sender: TcxGridTableView; ACanvas: TcxCanvas;
AViewInfo: TcxGridColumnHeaderViewInfo; var ADone: Boolean);
var
r:trect;
begin
r:=AViewInfo.Bounds;
if AViewInfo.column.Caption='工资' then
begin
ACanvas.FillRect(r);
ACanvas.Pen.Color:=rgb(0,0,0);
ACanvas.MoveTo(r.Right-1,r.Top);
ACanvas.LineTo(r.Right-1,r.Bottom);
ACanvas.MoveTo(r.Left,r.Bottom-1);
ACanvas.LineTo(r.Right-1,r.Bottom-1);
OffsetRect(r,2,2);
ACanvas.DrawTexT(AViewInfo.column.Caption,r,0);
ADone:=TRUE;
end;
end;
第二个问题用
self.cxGrid1DBTableView1.StoreToIniFile();
self.cxGrid1DBTableView1.RestoreFromIniFile();
祝你好运![
]