If anyone has tried loading a large number of items into a ComboBox…you’ve probably run into a long pause as the ComboBox renders an Element for each……and…..every….object….in….your….itemssource. You might have even resorted to using a ListBox instead even though it doesn’t quite fit in your UI.
Fear not my fellow WPF’ers because I have found the solution to your pain. ComboBox derives from ItemsControl and as such, has a ItemsPanel property of type ItemsPanelTemplate.
If you set the ItemsPanelTemplate to use a VirtualizingStackPanel, the ComboBox will virtualize and you will have a much more responsive ComboBox. Even better, setup a Style for all ComboBoxes in your app and set the ItemsPanel to be that IPT. You’ll be a much happier camper. My Combobox holding 5000 objects used to take around 5-10 seconds to show the popup. Now it pops up instantly.