Infragistics - 当数据源更改时禁用 ultrawingrid 自动更新

发布于 2024-12-25 02:25:45 字数 229 浏览 2 评论 0原文

我有一个绑定到数据表的winggrid。我创建一个新的异步线程,并从该线程进行远程服务器调用并传递数据表。服务器调用完成后,winggrid 会自动刷新以显示任何更改。然而,由于这不是在程序的主 UI 线程上完成的,因此我们经常会收到一个错误,其中控件突然消失,并且其中出现一个大的红色 X。

是否有一个标志可以将 wingrid 设置为在数据源更改时不自动更新?我想在远程服务器调用之前将其关闭,并在返回主线程后再次将其打开。

I have a wingrid that is bound to a datatable. I create a new asynchronous thread and from that thread make a remote server call passing the datatable. When the server call is completed the wingrid automatically refreshes to show any changes. However, since this is not being done on the main UI thread of the program, we will often get an error where the control goes whilte and a big red X appears in it.

Is there a flag to set the wingrid to not automatically upate when the datasource changes? I would like to turn it off before the remote server call and turn it on again after I am back on the main thread.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

伊面 2025-01-01 02:25:45

使用

Grid1.BeginUpdate()

解决办法是在异步方法之前 。此方法可防止网格绘制。 使用。

Grid1.EndUpdate()

然后在异步方法完成后在 UI 线程上

The solution was to use

Grid1.BeginUpdate()

before the asynchronous method. This methods prevents the grid from painting. Then use

Grid1.EndUpdate()

on the UI thread once the asynchronous method was done.

小草泠泠 2025-01-01 02:25:45

我认为你想要的是:

Grid1.SuspendRowSynchronization()

然后,完成后:

Grid1.ResumeRowSynchronization()

I think what you want is:

Grid1.SuspendRowSynchronization()

then, when done:

Grid1.ResumeRowSynchronization()
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文