【问题标题】:In focus row in Xceed datagrid doesn't get updatedXceed 数据网格中的焦点行未更新
【发布时间】:2014-03-08 06:23:56
【问题描述】:

我有一个 Xceed Datagrid,其 ItemsSource 是 XAML 中定义的 CollectionViewSource。每当更新网格时,只有焦点所在的行不会显示更新的值(恢复为原始值),但所有其他行都会更新。如果我直接将网格绑定到 ViewModel 中的集合,那么一切正常。问题只是当CollectionViewSource 出现时。任何帮助表示赞赏。

【问题讨论】:

    标签: xceed xceed-datagrid


    【解决方案1】:

    您能否尝试使用DataGridCollectionViewSource 而不是CollectionViewSource。通过使用它,您将获得DataGrid 的好处,例如内置过滤、排序、分组等。他们文档中的一个示例:

    <Grid xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid">
      <Grid.Resources>      
      <xcdg:DataGridCollectionViewSource x:Key="cvs_orders"
                                      Source="{Binding Source={x:Static Application.Current},
                                                          Path=Orders}"/>
      </Grid.Resources>
      <xcdg:DataGridControl x:Name="OrdersGrid"
                            ItemsSource="{Binding Source={StaticResource cvs_orders}}"/>
    </Grid>
    

    【讨论】:

      【解决方案2】:

      我有解决办法... grid.CurrentItem = null

      【讨论】:

      • 考虑使用我的解决方案作为替代方案。最好使用正确的解决方案而不是 hack
      猜你喜欢
      • 1970-01-01
      • 2011-10-26
      • 1970-01-01
      • 2014-02-18
      • 2015-10-13
      • 1970-01-01
      • 2019-03-14
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多