AutoPostback DropDownList in EditItemTemplate

Discussion in 'ASP .Net Datagrid Control' started by Guest, Oct 28, 2003.

  1. Guest

    Guest Guest

    I have a dropdownlist as an item in my edititemtemplate.
    I need to populate a texbox in the same edititemtemplate with the contents
    of the dropdown.

    Still with me?

    I have set autopostback on the dropdown and have set the
    onselectedindexchanged event to catch the change.

    Still with me???

    I know the event fires because it traces and goes bang if because I cannot
    find the relevant controls.

    Now how do I get at the controls in the template to get the value and
    populate my textbox.

    Grateful for any help

    Alan
    Guest, Oct 28, 2003
    #1
    1. Advertising

  2. Guest

    Guest Guest

    Sorry Found the answer, as is often the way, as soon as I posted the
    message.

    Cheers to anyone who thought of responding.

    FYI for anyone stuck on a similar problem

    Dim DDL As DropDownList

    Dim TB As TextBox

    DDL =
    DataGrid1.Items.Item(DataGrid1.EditItemIndex).FindControl("DropDownList1")

    TB = DataGrid1.Items.Item(DataGrid1.EditItemIndex).FindControl("TextBox1")

    TB.Text = DDL.SelectedItem.Text

    in the dropdownlist postback event
    works a treat
    <a> wrote in message news:...
    > I have a dropdownlist as an item in my edititemtemplate.
    > I need to populate a texbox in the same edititemtemplate with the contents
    > of the dropdown.
    >
    > Still with me?
    >
    > I have set autopostback on the dropdown and have set the
    > onselectedindexchanged event to catch the change.
    >
    > Still with me???
    >
    > I know the event fires because it traces and goes bang if because I cannot
    > find the relevant controls.
    >
    > Now how do I get at the controls in the template to get the value and
    > populate my textbox.
    >
    > Grateful for any help
    >
    > Alan
    >
    >
    Guest, Oct 28, 2003
    #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. George Durzi

    DropDownList in EditItemTemplate

    George Durzi, Sep 27, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    8,499
    George Durzi
    Sep 27, 2004
  2. =?Utf-8?B?Tkg=?=
    Replies:
    2
    Views:
    29,312
    =?Utf-8?B?Tkg=?=
    Mar 27, 2006
  3. WT
    Replies:
    2
    Views:
    4,568
  4. =?Utf-8?B?ZGVuIDIwMDU=?=

    No Value: DropDownlist in EditItemTemplate Gridview Problem

    =?Utf-8?B?ZGVuIDIwMDU=?=, Oct 11, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    535
    =?Utf-8?B?ZGVuIDIwMDU=?=
    Oct 11, 2006
  5. Steve Hershoff
    Replies:
    2
    Views:
    818
    Steve Hershoff
    Apr 11, 2007
Loading...

Share This Page