【问题标题】:WPF Infragistics xamDataGrid - CollectionView GroupDescriptions not recognized like with WPF DataGridWPF Infragistics xamDataGrid - 无法像 WPF DataGrid 一样识别 CollectionView GroupDescriptions
【发布时间】:2011-10-04 16:35:42
【问题描述】:

我们正在考虑将基于 WPF DataGrid 的应用程序升级到使用 Infragistics xamDataGrid DataGrid 控件的应用程序。

WPF DataGrid 的优点之一是它查看在包含您的集合的 CollectionView 上指定的 GroupDescriptions,并自动在 DataGrid 上创建这些组。

Infragistics xamDataGrid 似乎忽略了这些组描述。

有谁知道如何获取 xamDataGrid 绑定到的 ListCollectionView/CollectionView 中的 GroupDescriptions,以自动显示在 xamDataGrid 上,还是需要编写额外的代码?

【问题讨论】:

  • 您是否为此咨询过 Infragistics NetAdvantage 论坛?他们将更有能力回答这个问题。

标签: wpf datagrid grouping infragistics xamdatagrid


【解决方案1】:

查看这些论坛条目,您可以看到当前不支持此行为

http://forums.infragistics.com/forums/p/49473/261253.aspx#261253

你必须明确指定你想要什么

this.FieldSettings.AllowGroupBy = true;
this.GroupByAreaLocation = GroupByAreaLocation.AboveDataArea;

foreach (Field field in this.FieldLayouts.First().Fields) {
  if (field.Name.Euals(theFieldNameThatYouWant)){
    bool groupBy = true;
    field.Owner.SortedFields.Add(new FieldSortDescription(field.Name, ListSortDirection.Ascending, groupBy));
  }
}

希望对你有帮助

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-12-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-21
    相关资源
    最近更新 更多