AutoPostback DropDownList in EditItemTemplate

G

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
 
G

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
 

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,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top