By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,027 Members | 1,088 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,027 IT Pros & Developers. It's quick & easy.

Any good solutions for: SelectedValue which is invalid because it does not exist in the list of items?

P: n/a
Just trying to get multiple dropdowns's to work inside another control
(details view)
I'm seeing this error, but not consistantly. I can even cut and paste a
working set of controls into a new page, and somtimes it works and other
times it throws this error.

I'm sure this has come up before but I didn't see it in the history. Also,
the solutions I have found on the web are pretty old.
This is driving me crazy.
Jul 14 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Make sure that every ddl has its own collection of items. Even if the items
are the same, you need to have a separate copy of them for every ddl.

It may be not the culprit in your case, hard to say without seeing the code.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"randy.buchholz" <ra************@dads.state.tx.uswrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Just trying to get multiple dropdowns's to work inside another control
(details view)
I'm seeing this error, but not consistantly. I can even cut and paste a
working set of controls into a new page, and somtimes it works and other
times it throws this error.

I'm sure this has come up before but I didn't see it in the history.
Also, the solutions I have found on the web are pretty old.
This is driving me crazy.
Jul 14 '08 #2

P: n/a
Thanks Eliyahu,
Would have put code if there was any not generated. It can be reproduced
through dragging and dropping.
I put a details view on the page, convert several fields to template fields
and start adding databound ddl's to the fields. When I add new ddl and run
the page it will work. As I continue to add ddl's at some point it throws
the error. Once this eror shows, even if I remove the last (or other) ddl
(returing to a previously working state) the error persists.

Confirmed every ddl had its own source/dataset.

"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:e9**************@TK2MSFTNGP02.phx.gbl...
Make sure that every ddl has its own collection of items. Even if the
items are the same, you need to have a separate copy of them for every
ddl.

It may be not the culprit in your case, hard to say without seeing the
code.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"randy.buchholz" <ra************@dads.state.tx.uswrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>Just trying to get multiple dropdowns's to work inside another control
(details view)
I'm seeing this error, but not consistantly. I can even cut and paste a
working set of controls into a new page, and somtimes it works and other
times it throws this error.

I'm sure this has come up before but I didn't see it in the history.
Also, the solutions I have found on the web are pretty old.
This is driving me crazy.

Jul 15 '08 #3

P: n/a
Analyze carefully the sequence of events. See when the ddls get populated
and when the code is attempting to use the selected value. The likely reason
for the exception is the code wants the value before the ddls get their
items.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"randy.buchholz" <ra************@dads.state.tx.uswrote in message
news:uz**************@TK2MSFTNGP06.phx.gbl...
Thanks Eliyahu,
Would have put code if there was any not generated. It can be reproduced
through dragging and dropping.
I put a details view on the page, convert several fields to template
fields and start adding databound ddl's to the fields. When I add new ddl
and run the page it will work. As I continue to add ddl's at some point
it throws the error. Once this eror shows, even if I remove the last (or
other) ddl (returing to a previously working state) the error persists.

Confirmed every ddl had its own source/dataset.

"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:e9**************@TK2MSFTNGP02.phx.gbl...
>Make sure that every ddl has its own collection of items. Even if the
items are the same, you need to have a separate copy of them for every
ddl.

It may be not the culprit in your case, hard to say without seeing the
code.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"randy.buchholz" <ra************@dads.state.tx.uswrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>>Just trying to get multiple dropdowns's to work inside another control
(details view)
I'm seeing this error, but not consistantly. I can even cut and paste a
working set of controls into a new page, and somtimes it works and other
times it throws this error.

I'm sure this has come up before but I didn't see it in the history.
Also, the solutions I have found on the web are pretty old.
This is driving me crazy.


Jul 16 '08 #4

P: n/a
Yes, from what I have read about this issue this is essentially the problem.
The issue as I understand it is that there a sequence of calls within the
ddl processing and two of the calls are back-to-back inside the control.
There is no way to capture an event or error between these calls, so if the
first call provides bad or incomplete data the second call is still
executed, generating the error. I believe this is in the space between
databinding and databound. There a few nasty work-arounds and one that is
not so bad - creating a custom ddl control that overrides the binding
processes. I was hoping someone here may have heard of a better solution.

The problem with the solutions is tied to an in-house problem. I am the
only one in our organization that has any non-COBOL experience in the org,
and trying to teach COBOL programmers OO concepts is proving dificult. I'm
still a nub myself with less than 1 yr exp in .Net/C# or web/html. Haven't
programmed in a while, spent the last 30 years in management and decided to
get back to building things (but it seems there is no great demand for
Fortran developers :)). Anyway, I degress. Bottom line is I am trying to
stick to out-of the-box approaches right now for if I make things anymore
complex than that I will end up having to do support as well as development.

Thanks

"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:Oh**************@TK2MSFTNGP05.phx.gbl...
Analyze carefully the sequence of events. See when the ddls get populated
and when the code is attempting to use the selected value. The likely
reason for the exception is the code wants the value before the ddls get
their items.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"randy.buchholz" <ra************@dads.state.tx.uswrote in message
news:uz**************@TK2MSFTNGP06.phx.gbl...
>Thanks Eliyahu,
Would have put code if there was any not generated. It can be reproduced
through dragging and dropping.
I put a details view on the page, convert several fields to template
fields and start adding databound ddl's to the fields. When I add new
ddl and run the page it will work. As I continue to add ddl's at some
point it throws the error. Once this eror shows, even if I remove the
last (or other) ddl (returing to a previously working state) the error
persists.

Confirmed every ddl had its own source/dataset.

"Eliyahu Goldin" <RE**************************@mMvVpPsS.orgwrote in
message news:e9**************@TK2MSFTNGP02.phx.gbl...
>>Make sure that every ddl has its own collection of items. Even if the
items are the same, you need to have a separate copy of them for every
ddl.

It may be not the culprit in your case, hard to say without seeing the
code.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"randy.buchholz" <ra************@dads.state.tx.uswrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl.. .
Just trying to get multiple dropdowns's to work inside another control
(details view)
I'm seeing this error, but not consistantly. I can even cut and paste
a working set of controls into a new page, and somtimes it works and
other times it throws this error.

I'm sure this has come up before but I didn't see it in the history.
Also, the solutions I have found on the web are pretty old.
This is driving me crazy.




Jul 16 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.