|
-
Nov 29th, 2006, 06:14 AM
#1
Thread Starter
Addicted Member
databind array to combox
Hello
I have an array of objects
each object contains 3 strings
i.e
public classs testObject
{
public string name;
public string title;
public string address;
}
testObject arrayname = new testObject[5];
for (int i=0; i<arrayname.length; i++)
{
arrayname[i] = new testObject()
}
//another loop here to populate name, title and address for each object
How do i get a combobox populated so it displays the name, but I can actuall retrieve the address? I realise I have to set valuemember and displayMember
I thought the code below was along the right lines, but I dont know what to set the valuemember and displaymember to...
combobox.DataSource = arrayname
combobox.valuemember=
combobox. displayMember=
Thanks in advance
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|