修改cxGrid的Indicator,让其显示当前记录的编号
在view的DrawIndicatorCell事件中写入“
var
FValue:string;
FBounds:TRect;
begin
if Sender.OptionsView.Indicator then
begin
FBounds :=AViewInfo.Bounds;
if (AViewInfo is TcxGridIndicatorRowItemViewInfo) then
begin
ACanvas.FillRect(FBounds);
ACanvas.DrawComplexFrame(FBounds,clBtnHighlight,clBtnShadow,[bBottom,bLeft,bRight],1);
FValue :=IntToStr(TcxGridIndicatorRowItemViewInfo(AViewInfo).GridRecord.Index+1);
InflateRect(FBounds,-3,-2);
ACanvas.Font.Color :=clBlack;
ACanvas.Brush.Style :=bsClear;
ACanvas.DrawText(FValue,FBounds,cxAlignCenter or cxAlignTop);
ADone :=True;
end;
end;
end;

浙公网安备 33010602011771号