I have a Combobox which displaying 'a', 'b', 'c', 'd'.
The same Combobox I need to change the display order like 'c', 'a', 'd', 'b'.
Thanks in advance.
I have detailed explain below my code :-
I need to display Colors in my ComboBox but not all dotnet colors, I have to display only my required colors. Code below
private void FillComboBoxBorderColor(MoeValueMCInfo mcInfo)
{
comboBox_BorderColor.Items.Clear();
float mcVersion = 0;
if (float.TryParse(mcInfo.Version.StringValue, out mcVersion))
{
if (mcInfo.Level.ToString() == "Enterprise" && mcVersion >= 4.0)
{
Dictionary<string, string> deviceSupportedColors = new Dictionary<string, string>();
deviceSupportedColors.Add("0", "OrangeRed");
deviceSupportedColors.Add("1", "Orange");
deviceSupportedColors.Add("2", "Yellow");
ArrayList ColorList = new ArrayList();
Type colorType = typeof(System.Drawing.Color);
PropertyInfo[] propInfoList = colorType.GetProperties(BindingFlags.Static |
BindingFlags.DeclaredOnly | BindingFlags.Public);
foreach (PropertyInfo c in propInfoList)
{
if (deviceSupportedColors.ContainsValue(c.Name))
{
this.comboBox_BorderColor.Items.Add(c.Name);
}
}
}
}
}
So In that I need to display the ComboBox order would be
OrangeRed", "Orange", "Yellow", "LawnGreen", "MediumSpringGreen", "Aqua", "CadetBlue", "SlateBlue", "Violet", "Magenta", "MediumVioletRed", "Gray"
I tried using index but I could not achieve it. (My code mentioned in the command line)
What I have tried:
I used Index but that could not able to achieve.