gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 18:13:01 24 4
gpt4 key购买 nike

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

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

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

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

最佳答案

查看这些论坛条目,您会发现当前不支持此行为

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

希望这有帮助

关于WPF Infragistics xamDataGrid - CollectionView GroupDescriptions 无法像 WPF DataGrid 那样被识别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7651168/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com