Programatically controlling the inner controls of a Formview Control

Discussion in 'ASP .Net' started by Neil, Nov 16, 2005.

  1. Neil

    Neil Guest

    I'm trying to get up to speed on ASP.Net & C# development having come from a
    VB6 background.

    I know that I can refer to an inner control of a formview control by using a
    lines such as

    DropDownList ddlDeactivationId;
    int deacId;
    ddlDeactivationId =
    (DropDownList)FormView1.Row.FindControl("DropdownList2");
    deacId = ddlDeactivationId.SelectedIndex;


    What I'd like to know (and haven't figured out yet) is how I can
    programatically set the value of one of these inner controls?
    Neil, Nov 16, 2005
    #1
    1. Advertising

  2. RE: Programatically controlling the inner controls of a Formview Contr

    DropDownList ddlDeactivationId;
    ddlDeactivationId = (DropDownList)FormView1.Row.FindControl("DropdownList2");
    ddlDeactivationId.SelectedIndex = 2 //you can set the values like this...

    Thanks,
    Sridhar.

    "Neil" wrote:

    > I'm trying to get up to speed on ASP.Net & C# development having come from a
    > VB6 background.
    >
    > I know that I can refer to an inner control of a formview control by using a
    > lines such as
    >
    > DropDownList ddlDeactivationId;
    > int deacId;
    > ddlDeactivationId =
    > (DropDownList)FormView1.Row.FindControl("DropdownList2");
    > deacId = ddlDeactivationId.SelectedIndex;
    >
    >
    > What I'd like to know (and haven't figured out yet) is how I can
    > programatically set the value of one of these inner controls?
    >
    >
    >
    >
    >
    =?Utf-8?B?U3JpZGhhcg==?=, Nov 16, 2005
    #2
    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. Howard

    access inner formview controls

    Howard, Jul 31, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    6,892
    Ray Booysen
    Jul 31, 2006
  2. darkmage1975

    FormView and inner controls

    darkmage1975, Mar 2, 2007, in forum: .NET
    Replies:
    0
    Views:
    324
    darkmage1975
    Mar 2, 2007
  3. timcyberbanjo

    programatically controlling the datagrid

    timcyberbanjo, May 25, 2005, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    100
    Jeffrey Tan[MSFT]
    May 27, 2005
  4. shotokan99

    controlling wmp playlist programatically

    shotokan99, Sep 7, 2007, in forum: Javascript
    Replies:
    1
    Views:
    138
    Thomas 'PointedEars' Lahn
    Sep 7, 2007
  5. shotokan99

    help in controlling wmp programatically

    shotokan99, Sep 8, 2007, in forum: Javascript
    Replies:
    0
    Views:
    82
    shotokan99
    Sep 8, 2007
Loading...

Share This Page