Getting value of field in dropdown datasource within Formview

Discussion in 'ASP .Net' started by =?Utf-8?B?VEpIZXJtYW4=?=, Jun 19, 2006.

  1. 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??
    =?Utf-8?B?VEpIZXJtYW4=?=, 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. Chris

    Formview within Formview

    Chris, May 19, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    496
    Chris
    May 19, 2007
  2. TJHerman

    Getting value of field in Dropdown List within Formview

    TJHerman, Jun 19, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    156
    TJHerman
    Jun 19, 2006
  3. Jason
    Replies:
    0
    Views:
    201
    Jason
    Oct 24, 2006
  4. VUNETdotUS
    Replies:
    25
    Views:
    423
    Thomas 'PointedEars' Lahn
    Nov 10, 2007
  5. jr
    Replies:
    3
    Views:
    390
Loading...

Share This Page