因为DBGrid是数据感应的,你可以在从DataSet读取数据前,把DBGrid指定到把你的Cell中
如:
procedure TForm1.ShowCellText(ARow, ACol: Integer);
begin
DBGrid1.SelectedIndex := ACol;
DBGrid1.DataSource.DataSet.RecNo := ARow;
//注:RecNO有时不是很好用,
ShowMessage(DBGrid1.SelectedField.AsString);
end;
如:
procedure TForm1.ShowCellText(ARow, ACol: Integer);
begin
DBGrid1.SelectedIndex := ACol;
DBGrid1.DataSource.DataSet.RecNo := ARow;
//注:RecNO有时不是很好用,
ShowMessage(DBGrid1.SelectedField.AsString);
end;
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货