c# - Displaying individual element of objects in arraylist on combobox -


i have object 2 element fields c#, , have inserted them arraylist. trying them display on combobox.

this have

arraylist mylist = new arraylist(); mylist.add(new myobject("name1", "value1")); mylist.add(new myobject("name2", "value2")) mylist.add(new myobject("name3", "value3"));  combobox1.itemssource = drinksarray; 

the following code display 3 elements "classname.myobject" combobox.

i trying display "name1", "name2" , "name3".

i have getname() method object not know how implement combobox.

you have set combobox.displaymemberpath.

https://msdn.microsoft.com/en-us/library/system.windows.controls.itemscontrol.displaymemberpath(v=vs.110).aspx


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -