Getting value of field in Dropdown List within Formview

Discussion in 'ASP .Net Web Controls' started by TJHerman, Jun 19, 2006.

  1. TJHerman

    TJHerman 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 suggest!!!
     
    TJHerman, Jun 19, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?VEpIZXJtYW4=?=

    Getting value of field in dropdown datasource within Formview

    =?Utf-8?B?VEpIZXJtYW4=?=, Jun 19, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    650
    =?Utf-8?B?VEpIZXJtYW4=?=
    Jun 19, 2006
  2. Jerome
    Replies:
    1
    Views:
    626
    Jerome
    Jun 28, 2006
  3. Chris

    Formview within Formview

    Chris, May 19, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    586
    Chris
    May 19, 2007
  4. VUNETdotUS
    Replies:
    25
    Views:
    517
    Thomas 'PointedEars' Lahn
    Nov 10, 2007
  5. jr
    Replies:
    3
    Views:
    502
Loading...

Share This Page