Unbinding Dropdown after Bind?

M

Mark

I have a datagrid , which contains user controls. I dynamically create
DIFFERENT user controls on the itemcreated event and insert them into the
datagrid on load.
The user controls have dropdown lists in them. When the user control loads,
it binds these dropdowns. The initial load works great.
When the user pages I need to cache what they changed on the current page to
an object in session. So when I go back to the that page, their data is
still there. I also need to validate the data when they change pages. So I
need to rebind the grid to get the control values, becuase unless you
rebind, the user controls aren't there and you can't get what data the user
put in them.
So I do that and then I look at the data and have to highlight "offending"
fields in red. That means I need to REBIND again to reload the controls and
show the proper display. When I rebind the second time, my dropdowns dont'
show the selected item correctly. So what I somehow figured out was that
after I rebinded the dropdowns on the second load, I set the
..datasource=nothing and the selected item came up fine. THIS IS REALLY
WEIRD. Why would I need to set my datasource=nothing RIGHT AFTER binding it
in order for the selected item to show up correctly?

It works, so I'm fine, but some explanation would be cool.

thx
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top