Delphi7에서 cxGrid 컨트롤 자동 번호 매기기

1006 단어 DELPHI
cxGrid의 GridView 속성 설정 이벤트 onGridCustomDrawIndicator Cell에서 이벤트 키 코드는 다음과 같습니다.
procedure TfrmHidden_Trouble.GridCustomDrawIndicatorCell(  
  Sender: TcxGridTableView; ACanvas: TcxCanvas;  
  AViewInfo: TcxCustomGridIndicatorItemViewInfo; var ADone: Boolean);  
var  
  AIndicatorViewInfo: TcxGridIndicatorRowItemViewInfo;  
  ATextRect: TRect;  
  aCV:TcxCanvas;  
begin  
  inherited;  
  //======      cxLookAndFeelPainters  
  if not (AViewInfo is TcxGridIndicatorRowItemViewInfo) then  
    Exit;  
  aCV:=ACanvas ;  
  ATextRect := AViewInfo.ContentBounds;  
  AIndicatorViewInfo := AViewInfo as TcxGridIndicatorRowItemViewInfo;  
  InflateRect(ATextRect, -2, -1);  
  Sender.LookAndFeelPainter.DrawHeader(ACanvas, AViewInfo.ContentBounds,  
    ATextRect, [], cxBordersAll, cxbsNormal, taCenter, TcxAlignmentVert(vaCenter),  
    False, False, IntToStr(AIndicatorViewInfo.GridRecord.Index + 1),  
  acv.Font,acv.font.Color,acv.Brush.color );  
  ADone := True;  
end;  

좋은 웹페이지 즐겨찾기