private void DatePicker_SelectedDateChanged(object sender, SelectionChangedEventArgs e) { DateTime date = dataPicker.SelectedDate ?? DateTime.Now; var list = StockCalculate.GetExistMaterialsGroupByFashion(date); ObservableCollection <ExistMaterial> collection = new ObservableCollection <ExistMaterial>(list); ListCollectionView collection2 = new ListCollectionView(collection); collection2.GroupDescriptions.Add(new PropertyGroupDescription("Fashion")); dataGrid.ItemsSource = collection2; }
private void ReportView() { DateTime date = dataPicker.SelectedDate ?? DateTime.Now; string destination = comboBox.SelectedItem.ToString(); int idDest = BufferData.GetInstance().DestinationTable.Data.Find(x => x.Type == destination).IdDestination; int total = 0; var list = StockCalculate.GetMaterialsResult(date, idDest, ref total); label3.Content = total; ObservableCollection <ExistMaterial> collection = new ObservableCollection <ExistMaterial>(list); ListCollectionView collection2 = new ListCollectionView(collection); collection2.GroupDescriptions.Add(new PropertyGroupDescription("Fashion")); dataGrid.ItemsSource = collection2; }
private void comboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { int num = comboBox.SelectedIndex + 1; dataGrid.ItemsSource = StockCalculate.GetNotRequiredMaterials(num); }
public Report1Window() { InitializeComponent(); dataGrid.ItemsSource = StockCalculate.GetExistMaterialTable(); }