当前位置:网站首页>CXGRID keeps the original display position after refreshing the data

CXGRID keeps the original display position after refreshing the data

2022-06-13 01:43:00 Guoguo

cxgrid After refreshing the data, keep the original display position unchanged

var i,ti:integer;

begin

 i:=cxGrid1DBTableView1.Controller.FocusedRowIndex;  // Record the focus line number

 ti:=cxGrid1DBTableView1.Controller.TopRowIndex;     // Record top line number

  Data sets .Active:=False;

  Data sets .Active:=True;

 try

   cxGrid1DBTableView1.Controller.FocusedRowIndex:=i; // The focus line is positioned to the record value

   cxGrid1DBTableView1.Controller.TopRowIndex:=ti;    // Top line Navigate to the record value

 except

 end;

end;


DataController.RefreshExternalData; // Refresh the dataset


cxGridDBDataDefinitions;

TcxGridDBDataController(DataController).DataSet.Refresh;

原网站

版权声明
本文为[Guoguo]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202280551010001.html