I have a ComboBox, which when I re-fill it seems to take quite a while. After some profiling, I found that most of the time is spent in the ComboBox.Items.AddRange (Array) method. I have included the example method below, which shows how I am refilling the ComboBox.
public void Repopulate(IList<MyType> sortedList)
{
MyComboBox.BeginUpdate();
try
{
MyComboBox.Items.Clear();
MyComboBox.Items.AddRange(sortedList.ToArray());
}
finally
{
MyComboBox.EndUpdate();
}
}
sortedList 280 , 53 ComboBox, . , , ( 700 , 8000 ), . sortedList IList, 1 ( ).
ComboBox, , , IList, . .
- , , ComboBox?