Unbinding Dropdown after Bind?
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.
|All times are GMT. The time now is 11:57 AM.|
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.