?
Solved

RadioButtonList_uom  has a SelectedValue which is invalid because it does not exist in the list of items.

Posted on 2011-03-02
5
Medium Priority
?
615 Views
Last Modified: 2012-05-11
i am using formview,
i just copied the controls which was working fine in the inserttemplate to edit template..

now i am getting this error
'RadioButtonList_qtyuom' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value




     <asp:RadioButtonList ID="RadioButtonList_qtyuom" runat="server" CellPadding="2"
                                                        CellSpacing="2" Height="15px" RepeatDirection="Horizontal"
                                                        SelectedValue='<%# Bind("quantity_uom") %>' Width="298px">
                                                        <asp:ListItem Value="D">Drum</asp:ListItem>
                                                        <asp:ListItem Value="T">Tons</asp:ListItem>
                                                        <asp:ListItem Value="Y">Yards</asp:ListItem>
                                                        <asp:ListItem Value="G">Gallons</asp:ListItem>
                                                    </asp:RadioButtonList>

can you help
0
Comment
Question by:eoswin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 9

Accepted Solution

by:
rawinnlnx9 earned 2000 total points
ID: 35020468
What you have looks right. What type of field is 'quantity_uom' can it be null? If so then you need a null item in your list that is hidden.

See this: http://stackoverflow.com/questions/1050794/databinding-of-radiobuttonlist-using-selectedvalue-possible
0
 
LVL 9

Expert Comment

by:joshbula
ID: 35020490
Whatever the database field "quantity_uom" is returning in the item being edited is not one of the values: D, T, Y, G.  It might be a null or empty value coming from the database, in which case doing an ISNULL on the query might help:  ISNULL(quantity_uom, -1) AS quantity_uom ...
0
 

Author Comment

by:eoswin
ID: 35020724
thanks the solution works fine..

 the type is char(1) null..

would you pls showing me how to add  a HIDDEN ListItem  value in my code ..  

 
0
 

Author Comment

by:eoswin
ID: 35020907
i did not notice it was in the link..  thanks
0
 
LVL 9

Expert Comment

by:rawinnlnx9
ID: 35022305
This is it with display: none

 <asp:ListItem Value="" Text="" style="display: none" />
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses
Course of the Month9 days, 5 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question