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;
相关文章推荐
- Delphi中使用cxGrid对数据集进行Sort和Locate操作
- delphi中cxgrid和数据库搭配的基本应用
- Delphi CxGrid 汇总(3)
- 三步轻松搞定delphi中CXGRID手动添加复表头(多行表头,报表头)
- delphi利用ADO读取Excel 显示在cxgrid
- Delphi : cxGrid的使用方法
- Delphi CxGrid 汇总(3)
- CxGrid导出到Excel(Delphi)
- delphi中cxGrid使用汇总(二)
- Delphi CxGrid 汇总(3)
- Delphi cxGrid默认选中整行
- delphi cxgrid导出excel去除货币符号
- Delphi CxGrid 汇总(4)
- Delphi CxGrid 汇总(4)
- delphi cxgrid 使用方法
- Delphi CxGrid 汇总(1)
- Delphi CxGrid 汇总(2)
- 三步轻松搞定delphi中CXGRID手动添加复表头(多行表头,报表头)
- Delphi CxGrid 汇总(3)
- Delphi CxGrid 汇总(4)