Solved

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

Posted on 2014-10-07
1
105 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
1 Comment
 
LVL 28

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

New Relic: Our company recently started researching several products to figure out what were the best ways for us to increase our web page speed and to quickly identify performance problems that we may be having. One of the products we evaluated wa…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…
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…

910 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

24 Experts available now in Live!

Get 1:1 Help Now