public GroupTraineetBySchool() { InitializeComponent(); bl = BL.FactoryBL.GetBL(); foreach (Trainee item in bl.getTraineeList()) { foreach (Trainee item1 in bl.GetAllTraineeBySchool(BE.School.drivingSchool)) { item.NameOfSchool = item1.NameOfSchool; } } this.dataGrid.ItemsSource = bl.getTestsList(); ListCollectionView collection = new ListCollectionView(bl.getTraineeList()); collection.GroupDescriptions.Add(new PropertyGroupDescription("NameOfSchool")); dataGrid.ItemsSource = collection; foreach (Trainee item in bl.getTraineeList()) { foreach (Trainee item1 in bl.GetAllTraineeBySchool(BE.School.d_school)) { item.NameOfSchool = item1.NameOfSchool; } } this.dataGrid.ItemsSource = bl.getTestsList(); ListCollectionView collection1 = new ListCollectionView(bl.getTraineeList()); collection.GroupDescriptions.Add(new PropertyGroupDescription("NameOfSchool")); dataGrid.ItemsSource = collection; foreach (Trainee item in bl.getTraineeList()) { foreach (Trainee item1 in bl.GetAllTraineeBySchool(BE.School.drivingSchool)) { item.NameOfSchool = item1.NameOfSchool; } } this.dataGrid.ItemsSource = bl.getTestsList(); ListCollectionView collection2 = new ListCollectionView(bl.getTraineeList()); collection.GroupDescriptions.Add(new PropertyGroupDescription("NameOfSchool")); dataGrid.ItemsSource = collection; }