使用Delphi XE2。
我有一个连接到数据源的tcxgrid,它正在查看数据库中的一个表,cxgrid显示该表中的字段和记录。
有人知道如何刷新tcxgrid而不丢失当前选中的行吗?
谢谢,
发布于 2017-09-05 06:42:01
要恢复选择,可以使用cxStatusKeeper (这是一个公共单元,可以从DevExpress的支持中心下载):
{Init the component for restore selection}
FGridStatus := TcxGridDBTableKeeper.Create(self);
FGridStatus.LoadExpanding := False;
FGridStatus.LoadSelection := True;
FGridStatus.LoadFocus := True;
FGridStatus.LoadTopRecord := False;
FGridStatus.LoadWithDetails := False;
FGridStatus.LoadFocusedView := True;
FGridStatus.LoadFocusedItem := True;
FGridStatus.View := gvTableElementi;
{save the current items}
FGridStatus.Store;
{restore the selection}
if FGridStatus.GridStored then
FGridStatus.Restore;https://stackoverflow.com/questions/29102945
复制相似问题