开发者

WPF Infragistics xamDataGrid - CollectionView GroupDescriptions not recognized like with WPF DataGrid

开发者 https://www.devze.com 2023-04-11 05:21 出处:网络
We\'re looking at upgrading our WPF DataGrid based application to one that uses the Infragistics xamDataGrid DataGri开发者_运维知识库d control.

We're looking at upgrading our WPF DataGrid based application to one that uses the Infragistics xamDataGrid DataGri开发者_运维知识库d control.

One of the nice things about the WPF DataGrid was that it looked at GroupDescriptions specified on the CollectionView that wrapped your collection, and automatically created those groups on the DataGrid.

The Infragistics xamDataGrid seems to ignore these group descriptions.

Does anyone know how to get the GroupDescriptions in the ListCollectionView/CollectionView that the xamDataGrid is bound to, to show on the xamDataGrid automatically, or does this require writing additional code?


look at these forum entry and you can see that this behaviour currently not supported

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

you must explicit specify what you want

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

hope this helps

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号