View Single Post
  #7 (permalink)  
Old December 1st, 2005, 04:31 PM
steve35719 steve35719 is offline
Authorized User
 
Join Date: Nov 2005
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The original code does not work at all. I've had to remove: SelectedValue='<%# Bind("Color") from the tags of the DropDownList because I keep getting an error:
'DropDownList1' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value

So, I'm trying to do the binding in the code-behind but not having much luck.
I've left the Label in the ItemTemplate still bound to color:
 <asp:Label ID="Label1" runat="server" Text='<%# Bind("Color") %>'></asp:Label>
For some reason, I can't get my selection in DropDownList1 to equal the text of Label1 so that it can be bound to the Color Value of the DetailsView. The DropDownList is a static population; thus, it does not receive its value from another DataSource.

Let me ask you, how would you go about accomplishing this task? I can't tell you how many times I've gone through the web, my Beginning Dynamic Websites, ASP.NET 2.0 Beta, and ASP.NET 2.0 Databases books looking for the answers.

Thank you for your time Imar.

Reply With Quote