Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > AutoPostback DropDownList in EditItemTemplate

Reply
Thread Tools

AutoPostback DropDownList in EditItemTemplate

 
 
Guest
Posts: n/a
 
      10-28-2003
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


 
Reply With Quote
 
 
 
 
Guest
Posts: n/a
 
      10-28-2003
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).Find Control("DropDownList1")

TB = DataGrid1.Items.Item(DataGrid1.EditItemIndex).Find Control("TextBox1")

TB.Text = DDL.SelectedItem.Text

in the dropdownlist postback event
works a treat
<a> wrote in message news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
No Value: DropDownlist in EditItemTemplate Gridview Problem =?Utf-8?B?ZGVuIDIwMDU=?= ASP .Net 0 10-11-2006 11:34 AM
How to set selection in dropdownlist included in a Gridview <EditItemTemplate> WT ASP .Net 2 05-03-2006 02:59 PM
gridview: selected value of dropdownlist in edititemtemplate =?Utf-8?B?Tkg=?= ASP .Net 2 03-27-2006 12:43 PM
how do i access a dropdownlists selected value in a datagrid edititemtemplate column from the selectedindexchanged event of another dropdownlist in a datagrid edititemtemplate column Dave M ASP .Net Datagrid Control 0 12-14-2004 11:53 AM
DropDownList in EditItemTemplate George Durzi ASP .Net 1 09-27-2004 05:36 PM



Advertisments