procedure TForm1.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
begin
with DBGrid1.DataSource.DataSet do
begin
if DataCol = 0 then//第一列
DBGrid1.Canvas.TextRect(Rect, Rect.Left + 2, Rect.Top + 2, IntToStr(RecNo));
end;
end;
end.
dbgrid自动生成编号
最新推荐文章于 2019-10-16 08:16:22 发布