views:

234

answers:

0

I have a combobox created in code with 30,000 items in WPF, and it was truly slow - probably rendering all the rows. I did this to fix it:

cboValue = System.Windows.Markup.XamlReader.Parse("<ComboBox xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation""&gt;&lt;ComboBox.ItemsPanel&gt;&lt;ItemsPanelTemplate&gt;&lt;VirtualizingStackPanel/&gt;&lt;/ItemsPanelTemplate&gt;&lt;/ComboBox.ItemsPanel&gt;&lt;/ComboBox&gt;")

Handy if you need something like that