您的位置:首页 > 编程语言 > Delphi

delphi-cxgrid-cxtreelist加行序号

2012-06-27 22:29 225 查看
OptionsView.Indicator = True
OptionsView.IndicatorWidth = 40//宽度
procedure cxGridCustomDrawIndicatorCell(
Sender: TcxGridTableView; ACanvas: TcxCanvas;
AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean);
var
FValue: string;
FBounds: TRect;
begin
FBounds := AViewInfo.Bounds;
if (AViewInfo is TcxGridIndicatorRowItemViewInfo) then
begin
ACanvas.FillRect(FBounds);
ACanvas.DrawComplexFrame(FBounds, clBlack, clBlack, [bBottom, bLeft, bRight], 1);
FValue :=IntToStr(TcxGridIndicatorRowItemViewInfo(AViewInfo).GridRecord.Index+1);
InflateRect(FBounds, -1, -1); //Platform specific. May not work on Linux.
if TcxGridIndicatorRowItemViewInfo(AViewInfo).GridRecord.Index = Sender.DataController.FocusedRecordIndex then
begin
ACanvas.Font.Color := clWhite;
ACanvas.Brush.Style := bsSolid;
end
else
begin
ACanvas.Font.Color := clBlack;
ACanvas.Brush.Style := bsClear;
end;
ACanvas.DrawText(FValue, FBounds, cxAlignCenter or cxAlignTop);
ADone := True;
end;
end;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: