3

We're looking at upgrading our WPF DataGrid based application to one that uses the Infragistics xamDataGrid DataGrid 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?

4

1 回答 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));
  }
}

希望这可以帮助

于 2011-11-29T14:08:41.993 回答