首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >刷新tcxgrid而不丢失当前选中/突出显示的行

刷新tcxgrid而不丢失当前选中/突出显示的行
EN

Stack Overflow用户
提问于 2015-03-17 23:20:47
回答 1查看 1.1K关注 0票数 0

使用Delphi XE2。

我有一个连接到数据源的tcxgrid,它正在查看数据库中的一个表,cxgrid显示该表中的字段和记录。

有人知道如何刷新tcxgrid而不丢失当前选中的行吗?

谢谢,

EN

回答 1

Stack Overflow用户

发布于 2017-09-05 06:42:01

要恢复选择,可以使用cxStatusKeeper (这是一个公共单元,可以从DevExpress的支持中心下载):

代码语言:javascript
复制
{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;
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29102945

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档