I have a Winforms ComboBox that contains instances of a custom class. When the items are first added to the Items collection of the ComboBox, the
I use this extension:
///
/// Recreates the items
///
public static void RefreshItems(this ComboBox cb)
{
var selectedIndex = cb.SelectedIndex;
cb.SelectedIndex = -1;
MethodInfo dynMethod = cb.GetType().GetMethod("RefreshItems", BindingFlags.NonPublic | BindingFlags.Instance);
dynMethod.Invoke(cb, null);
cb.SelectedIndex = selectedIndex;
}