WPF Infragistics xamDataGrid - CollectionView GroupDescriptions不像WPF DataGrid那样被识别

3
我们正在考虑将基于WPF DataGrid的应用程序升级为使用Infragistics xamDataGrid DataGrid控件的应用程序。
WPF DataGrid的一个好处是它会查看包装集合的CollectionView上指定的GroupDescriptions,并自动在DataGrid上创建这些组。
然而,Infragistics xamDataGrid似乎忽略了这些组描述。
有没有人知道如何使xamDataGrid自动显示ListCollectionView/CollectionView中绑定到的GroupDescriptions,还是需要编写额外的代码?

你是否在Infragistics NetAdvantage论坛上咨询过这个问题?他们会更有能力回答它。 - WPF-it
1个回答

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));
  }
}

希望这有所帮助。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接