I’m new to C# and GUI programming, so I have a feeling this is a simple one, but the docs on DisplayMember are confusing me.
List<string[]> serverInfo = new List<string[]>();
serverInfo.Add(new string[] { "server one", "1.2.3.4", "12345" });
serverInfo.Add(new string[] { "server two", "1.2.3.4", "12346" });
serverInfo.Add(new string[] { "server three", "1.2.3.5", "12343" });
ComboBox serverPickList = new ComboBox();
serverPickList.DataSource = serverInfo;
serverPickList.DisplayMember = "???";
The ComboBox’s options should be “server one”, “server two”, and “server three”, but I still want the string[] arrays bound as I’ll be processing them.
Why won’t you make a class out of it?
And then: