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
.
Comments
Post a Comment