generate functionTue, 07 Feb 2023

wpf listcollectionview grouping by multiple columns

// reference: http://stackoverflow.com/a/13017748/1768303 // model public class Person { public string FirstName { get; set; } public string LastName { get; set; } public string City { get; set; } } // ViewModel List<Person> people = new List<Person> { new Person { FirstName = "John", LastName = "Doe", City = "London"}, new Person { FirstName = "John", LastName = "Smith", City = "New York" }, new Person { FirstName = "Jane", LastName = "Smith", City = "London" }, new Person { FirstName = "John", LastName = "Smith", City = "Paris" }, }; ListCollectionView view = new ListCollectionView(people); view.GroupDescriptions.Add(new PropertyGroupDescription("FirstName")); view.GroupDescriptions.Add(new PropertyGroupDescription("LastName")); // View <ListBox x:Name="my

Questions about programming?Chat with your personal AI assistant