Solved

Accessing the value of a RadioButtonList that is in a template field

Posted on 2014-10-07
1
124 Views
Last Modified: 2014-11-25
I have an app that allows our staff to submit client referrals. I'm currently working on a management page that allows the resposible staff member to manage the referrals and send them to the correct staff member / department. The page is written in VB and has a sql back end.

I have a detailsview with a number of template fields. The one I am interested in is the Assigned To RadioButtonList. I have configured it so that its text is the staff member's name and its value is thier email address.

In the next row I have a dropdown list that is supposed to display the email address of the selected staff member based on the selected value of the Assigned To Radiobuttonlist.selectedvalue.

I normally just use the datasource wizard and base a where clause on a control, but when I try this when the control is in a template field it is not listed in the available controls.

Does anyone know how to have my control added to the list or know of another way of doing this?
Assigned To RBL not listed
I've also tried the following code with no success:

If ReferralsManagementDV.CurrentMode = DetailsViewMode.Edit Then
            Dim ReferralAssignedToRBL As RadioButtonList = DirectCast(ReferralsManagementDV.FindControl("ReferralAssignedToRBL"), RadioButtonList)
            Dim ReferralAssignedToEmail As TextBox = DirectCast(ReferralsManagementDV.FindControl("ReferralAssignedToEmailTB"), TextBox)
            If (ReferralAssignedToRBL.SelectedValue) IsNot Nothing Then
                ReferralAssignedToEmail.Text = ReferralAssignedToRBL.SelectedValue.ToString
            End If

            SendStatusUpdateButton.Visible = False
            CloseTicketButton.Visible = False

        End If

Open in new window


I receive the "'ReferralAssignedToRBL' has a SelectedValue which is invalid because it does not exist in the list of items.
Parameter name: value error when I click the edit button.
0
Comment
Question by:ICantSee
[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
1 Comment
 
LVL 29

Accepted Solution

by:
sammySeltzer earned 500 total points
ID: 40368814
It looks like the columnName you are trying to use is empty.

Try and see if this helps you resolve it:

http://forums.asp.net/t/1243633.aspx?+RadioButtonList1+has+a+SelectedValue+which+is+invalid+because+it+does+not+exist+in+the+list+of+items+
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

If I have to fix slow responding website my first thoughts are server side optimizations: the database may not be optimized or caching is not enabled, or things like that. We often overlook another major part of our web application: the client. We o…
Introduction A frequently used term in Object-Oriented design is "SOLID" which is a mnemonic acronym that covers five principles of OO design.  These principles do not stand alone; there is interplay among them.  And they are not laws, merely princ…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

688 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