Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 15, 2012 11:03 AM by Spyderco
Feb 15, 2012 09:27 AM|LINK
Can anyone please give me a sample of how to use the control toolkit combobox, to display a list of OU's from active directory. which can then be selected to use in object creation.
I've been trying for hours, and i have managed to get the combobox to display all the current ou's. but selecting any of them and then doing a postback, returns no item selected.
Below is the bit of code i had been using for generating the ou list, can you tell me how to properly pass this list to a combobox.
public static List<DirectoryEntry> Clients()
List<DirectoryEntry> clients = new List<DirectoryEntry>();
foreach (DirectoryEntry child in domain.Children)
catch (System.Exception ex)
Feb 15, 2012 09:41 AM|LINK
Are you only populating the ListBox if !IsPostBack (If Not IsPostback in VB)? If you bind the ListBox again in Page_Load after a postback (which is what it sounds like you are doing), it will overwrite the selection before calling your ListBox_Selected
Feb 15, 2012 09:53 AM|LINK
here is the method i am using for populating the list in page_load
combClients.DataSource = ADLink.Clients();
I dont have a selected event, could that be the problem?
Feb 15, 2012 11:03 AM|LINK
Sorted it, was being a muppet, had a clear.items method being called on the combobox on page load :(