How do I make the items in the combo box appear in alphabetical order?
How do I make the items in the combo box appear in alphabetical order?
You use google.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.
This is certainly one way of going about it, since I don't believe there are any built in sorting helpers in the ComboBox object.Code:List<object> items = new List<object>(); foreach (object o in comboBox1.Items) items.Add(o); items.Sort((x, y) => x.ToString().CompareTo(y.ToString())); comboBox1.Items.Clear(); comboBox1.Items.AddRange(items.ToArray());
Last edited by theoobe; 05-24-2011 at 05:37 AM.
There may be, if you are using windows.forms. Only works for a non data-bound combobox. Under WPF there aren't. The idea here being to sort before populating the control.
Originally Posted by brewbuck:
Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.