Getting value of field in Dropdown List within Formview

T

TJHerman

I have a dropdown list in a Formview that includes a number of fields in the
SQLDatasource.

I want to be able to get the value of one of the fields in the Datasource
that is not the Datatextfield or the Datavaluefield from within a Formview
control.

I know that I can get the data text field or datavalue field by using the
following:
-Dim ddlCompanyName as DropDownList
-Dim txtCompanyName as Textbox
-ddlCompanyName = CType(FormView1.Row.FindControl("ddlCompanyName"),
DropDownList)
-txtCompanyName =
CType(FormView1.Row.findcontrol("CompanyNameTextbox"),Textbox)
-txtCompanyName.text = ddlCompanyName.Items(ddlCompanyName.SelectedIndex).Text

But how can I get the value from a different field in the datasource?

Please suggest!!!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top