Solved

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

Posted on 2014-10-07
1
101 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
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…

760 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

18 Experts available now in Live!

Get 1:1 Help Now