连着的啊,都把数据显示出来了。帮助是这样写的: property RecNo: Integer;DescriptionAs implemented in TDataSet, the value of RecNo is always -1. Ordinarily an application does not access RecNo at the TDataSet level. Instead a re-implemented RecNo property in a descendant class such as TTable is accessed. RecNo provides a fallback property for derived datasets that do not support record numbers.
要不就是你的DBGRID没有和数据库连接起来
property RecNo: Integer;DescriptionAs implemented in TDataSet, the value of RecNo is always -1. Ordinarily an application does not access RecNo at the TDataSet level. Instead a re-implemented RecNo property in a descendant class such as TTable is accessed. RecNo provides a fallback property for derived datasets that do not support record numbers.
如果是那种,删除的就会空着啊,也不能体现真正的行号啊?
在DataSet的OnCalcFields事件中加代码:With DataSet do begin
FieldByName('FRecNo').asInteger:=i+1;
end;以后调用字段 FRecNo 就是真正的行号。
FieldByName('FRecNo').asInteger:=i+1;
i:=i+1;
end;