Link to home
Start Free TrialLog in
Avatar of gggoddard
gggoddard

asked on

How do I add code to a dropdownlist's selected index changed event When the DDL is inside of a detailsView control ?

Hi;
I want to add today's date to a row of a detailsView control when the selected index changed event fires for a dropdownlist, which is located in the the same detailsView

All this happens in the detailView.Updating event so that is where I am trying to write my code.

This is what I want to do:

So far I know that 1) Place code in detailsview1.rowupdating event .

                               2) Make a row copy, not sure about the syntax here

           Dim aRow As DetailsViewRow = Me.DetailsView1.Rows(DetailsView1.Rows.Item(?))

                  3) Find my DDL

                Dim aDDL as dropdownlist = CType(aDDL.cells(?).Findcontrol("Dropdownlist3"0, dropdownlist)

                 If aDLL.selected IndexChanged then

                 Dim aTextbox as textbox = Ctype(detaislview.cells(?).findcontrol("Textbox6", textbox6)

                  aTextbox.text =   now()    

    I tried this code i.e. stepped through it and the value of the textbox changed in the locals windows but it did not change in the table column for the record that I was updating.

Is my problem caused by my having my code in the wrong event ? detailView.Updating .
If so what event should I use ?

     Thanks

ASKER CERTIFIED SOLUTION
Avatar of gggoddard
gggoddard

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Obadiah Christopher
I think u should try doing it in the ItemCommand event.