如何刷新 Infragistics UltraGrid?
我正在使用 Infragistics UltraGrid 和 datasouce Windows Bindingsouce。 在更改时,我向 Bindingsouce 提供数据源并调用 UltraGrid 的 DataBinding。 Bindingsouce 的数据源中的值发生变化,但这不会反映在 UltraGrid 中。
I am using Infragistics UltraGrid with datasouce Windows Bindingsouce.
On change, I provide datasouce to Bindingsouce and call DataBinding of UltraGrid. Value in the datasouce of Bindingsouce changes, but that is not reflected in the UltraGrid.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的绑定源必须引发一些事件来触发网格刷新。例如,如果您使用
BindingList
,它应该引发ListChanged
事件。Your binding source must raise some event to trigger grid refresh. For example, if you are using
BindingList
it should raise theListChanged
event.另外,请确保您用作 Binding Object 的任何类都实现 INotifyPropertyChanged,以便当您在运行时更新 BindingObject 时,它会被引导到 BindingSource,而 BindingSource 最终会被 Grid 拾取。
即:
请参阅此处的 MDSN 文章
还取决于您是否在 Grid 外部更改集合(在运行时,因为如果这样做,您需要使用
BindingList
并将其分配给BindingSource
Also, make sure that whatever class that you are using as your Binding Object implements INotifyPropertyChanged so that when you update the BindingObject at run time it gets channeled to BindingSource which eventually gets picked up by Grid.
i.e.:
see MDSN article here
Also depends if you changing the collection outside Grid (at runtime, because if you do, you need to use
BindingList<T>
and assign it toBindingSource