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
608 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
  • 2
  • 2
5 Comments
 
LVL 9

Accepted Solution

by:
rawinnlnx9 earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
i did not notice it was in the link..  thanks
0
 
LVL 9

Expert Comment

by:rawinnlnx9
Comment Utility
This is it with display: none

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

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now