473,382 Members | 1,362 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Dropdown

Howdy,

I'm getting an error and I'm not sure why:

System.ArgumentOutOfRangeException: 'ddManufacturer' has a SelectedValue
which is invalid because it does not exist in the list of items. Parameter
name: value at
System.Web.UI.WebControls.ListControl.PerformDataB inding(IEnumerable
dataSource) at System.Web.UI.WebControls.ListControl.OnDataBindin g(EventArgs
e) at System.Web.UI.WebControls.ListControl.PerformSelec t() at
System.Web.UI.WebControls.BaseDataBoundControl.Dat aBind() at

This is occuring in the Page_PreRender event of a custom user control. The
actual value isn't set to the drop down until the Page_Load Event so why the
error?

I received the same error with another dropdown list on another page but was
not being fired on either Page event. To correct it, I put the
ddItems.SelectedValue = "test" BEFORE the line to load the dropdown and that
resolved it. Why? Am I missing something?

Thanks a ton

Merry Christmas
David Lozzi
Dec 8 '06 #1
1 1624
Can you post some code?

--
Regards,
Alvin Bruney
------------------------------------------------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc

"David Lozzi" <dl****@nospam.nospamwrote in message
news:Ok****************@TK2MSFTNGP06.phx.gbl...
Howdy,

I'm getting an error and I'm not sure why:

System.ArgumentOutOfRangeException: 'ddManufacturer' has a SelectedValue
which is invalid because it does not exist in the list of items. Parameter
name: value at
System.Web.UI.WebControls.ListControl.PerformDataB inding(IEnumerable
dataSource) at
System.Web.UI.WebControls.ListControl.OnDataBindin g(EventArgs e) at
System.Web.UI.WebControls.ListControl.PerformSelec t() at
System.Web.UI.WebControls.BaseDataBoundControl.Dat aBind() at

This is occuring in the Page_PreRender event of a custom user control. The
actual value isn't set to the drop down until the Page_Load Event so why
the error?

I received the same error with another dropdown list on another page but
was not being fired on either Page event. To correct it, I put the
ddItems.SelectedValue = "test" BEFORE the line to load the dropdown and
that resolved it. Why? Am I missing something?

Thanks a ton

Merry Christmas
David Lozzi

Dec 11 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Joseph Barron | last post by:
Here is a SIMPLE problem that I'm trying to solve. It works in Netscape 6.2, but IE6 gives ""No such interface supported." Below are page1.htm and page2.htm . In page1.htm, there are two...
0
by: Toonman | last post by:
I have a webpage with a <form> consisting of a large table grid of dropdown lists used to make changes in a database. Some of these dropdown lists have the same value. I'm trying to make it so...
6
by: Rey | last post by:
Howdy, all. Appreciate your help. Have a one to many relation between a client and visit table. In the visit subform, I have a visittype and counselor field which are comboboxes. If I set...
13
by: melih.onvural | last post by:
Group, I'm having a tough time understanding some of the previous posts on this topic so I wanted to write what I've tried and hope that you can help me troubleshoot. I have a dropdown populated...
2
by: 23s | last post by:
I have a dropdown bound to a dataview. The binding assigns the dropdown with a SelectedIndex of 0. There is a msgbox in the SelectedIndexChanged event that displays the SelectedIndex property....
5
by: Gil | last post by:
Is there a way to tell if a combbox is in dropdown mode. I tried and if statement combobox.dropdown = true but i get an error. dropwndown function doesnt store if its true or false what i am...
3
by: CSharpguy | last post by:
I'm trying to populate a drop down with dates from a data field in my data base but I want the format like MM/dd/yyyy instead of 1/1/2006 12:00 PM How can I my date to show as 1/1/2006? I'm...
3
by: devNorway | last post by:
I have been struggling with a problem for days now, and searched for related problems and solutions but had no luck. I have two dropdown listboxes where the first is populated in page load and...
0
by: Kay | last post by:
Hello, I have written my own custom control and I want one of its properties to display as a dropdown list when clicked, so the user can select from the list, it would be similar to the asp...
0
by: Kay O'Keeffe | last post by:
Hello, I have written my own custom control and I want one of its properties to display as a dropdown list when clicked, so the user can select from the list, it would be similar to the asp...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.