cxgrid如何自动选中我查询出的数据
查询某条数据,如何自动选中cxgrid对应表的该条数据
[解决办法]
- Delphi(Pascal) code
cxGrid1DBTableView1.DataController.KeyFieldNames:='ID'; if cxGrid1DBTableView1.DataController.LocateByKey('2') then showmessage('当前焦点行就是键字段ID的值为“2”的记录') else showmessage('找不到符合的记录');
[解决办法]
dataset.locate('id',100,[]);