private void Order_Price_Group(object sender, RoutedEventArgs e) { OrderView.Filter = null; OrderView.GroupDescriptions.Clear(); OrderView.SortDescriptions.Add(new SortDescription("Amount", ListSortDirection.Descending)); ProductPriceGrouper grouper = new ProductPriceGrouper { Interval = 2000 }; OrderView.GroupDescriptions.Add(new PropertyGroupDescription("Amount", grouper)); }
private void Group_Product(object sender, RoutedEventArgs e) { RadioButton radio = sender as RadioButton; if (radio.Name == "Group_Category") { ProductView.GroupDescriptions.Clear(); ProductView.GroupDescriptions.Add(new PropertyGroupDescription("Category")); } else if (radio.Name == "Group_Price") { ProductView.Filter = null; ProductView.GroupDescriptions.Clear(); ProductView.SortDescriptions.Add(new SortDescription("Price", ListSortDirection.Descending)); ProductPriceGrouper grouper = new ProductPriceGrouper { Interval = 200 }; ProductView.GroupDescriptions.Add(new PropertyGroupDescription("Price", grouper)); } }