Sunday, 15 July 2012

c# - Iterating through a list of objects and displaying the property in the combobox -



c# - Iterating through a list of objects and displaying the property in the combobox -

i have 2 combo boxes, first 1 lets pick interface , sec 1 should display appropriate addresses depending on interface chose, have list of objects, each object interface associated addresses. need display these addresses combo box after user chooses interface connect to.

here have far , problem displays addresses first interface. addresscnt number of addresses each interface.

private void cbointerface_selectedindexchanged(object sender, eventargs e) { lbladdress.text = cbointerface.selecteditem.tostring(); cboaddress.items.clear(); (int x = 0; x < interface[0].addresscnt; x++) { cboaddress.items.add(interface[0].addressbuff[x].tostring()); } }

c#

No comments:

Post a Comment