2009-11-10 139 views
2

我正在使用Infragistics UltraGrid和datasouce Windows Bindingsouce。 在更改时,我向Bindingsouce提供数据,并调用UltraGrid的DataBinding。 Bindingsouce数据量中的值发生了变化,但这并不反映在UltraGrid中。如何刷新Infragistics UltraGrid?

回答

2

你绑定源必须提出一些事件来触发电网刷新。例如,如果您正在使用BindingList它应该引发ListChanged事件。

2

此外,请确保无论您用作绑定对象的任何类实现INotifyPropertyChanged,以便在运行时更新BindingObject时,它将被引导至BindingSource,最终将被网格拾取。

即:

BindingList<Foo> lstItems = new BindingList<Foo>; 
BindingSource bso = ; 
bso.DataSource = lstItems; 
Grid.DataSource = bso; 

public class Foo : INotifyPropertyChanged 

see MDSN article here

另外还要看如果你改变集电电网外(在运行时,因为如果你这样做,你需要使用BindingList<T>并将其分配给BindingSource

相关问题