Getting value of field in dropdown datasource within Formview

G

Guest

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 help with any suggestions??
 

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

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top