【问题标题】:How to refresh an Infragistics UltraGrid?如何刷新 Infragistics UltraGrid?
【发布时间】:2009-11-10 12:01:19
【问题描述】:

我正在使用 Infragistics UltraGrid 和 datasouce Windows Bindingsouce。 在更改时,我向 Bindingsouce 提供数据源并调用 UltraGrid 的 DataBinding。 Bindingsouce 的数据源中的值发生变化,但在 UltraGrid 中没有体现。

【问题讨论】:

    标签: infragistics ultrawingrid


    【解决方案1】:

    您的绑定源必须引发一些事件来触发网格刷新。例如,如果您使用BindingList,它应该引发ListChanged 事件。

    【讨论】:

      【解决方案2】:

      此外,请确保您用作绑定对象的任何类都实现了 INotifyPropertyChanged,这样当您在运行时更新 BindingObject 时,它会被引导到最终被 Grid 拾取的 BindingSource。

      即:

      BindingList<Foo> lstItems = new BindingList<Foo>;
      BindingSource bso = ;
      bso.DataSource = lstItems; 
      Grid.DataSource = bso; 
      
      public class Foo :  INotifyPropertyChanged
      

      see MDSN article here

      还取决于您是否在 Grid 之外更改集合(在运行时,因为如果这样做,您需要使用 BindingList&lt;T&gt; 并将其分配给 BindingSource

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-10-26
        • 1970-01-01
        • 2010-11-16
        相关资源
        最近更新 更多