Bound Dropdown list not filling before load events.

V

Victoria Bolton

I have an insert form that I want to double up as a edit form. I pass an id
number by querystring and then in the page_Loadcomplete I call a function
that fills the controls on the page with the data from a datareader.


Some of those controls are bound dropdownlists that have usernames, catagory
types and vendor names in etc. In my fill event I am trying this:


Me.ddlCat.SelectedIndex =
ddlCat.Items.IndexOf(ddlCat.Items.FindByText(Trim(rdr("CatName"))))


to select the correct item from the list. However it is not working. When I
break on my sub and check the ddlcat.items.count in the watch window it is
0. So I can only assume the page isn't loading the dropdowns by the time my
sub gets called. The dropdowns are bound using the wizards in design view of
the ASPX page.


I moved this function call from page load to page load complete in hopes of
fixing it but that didn't work so now I'm a little stumped, I also tried
init_complete with no joy. Any help will be greatly appreciated.


Victoria
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top