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

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 ?


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

gggoddardAuthor Commented:
I answered my own question.
I tried another detailView event
Like So:

Protected Sub DetailsView1_ItemCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DetailsViewCommandEventArgs) Handles DetailsView1.ItemCommand
If e.CommandName = "Update" Then
Dim aDDL As DropDownList = DetailsView1.FindControl("dropdownlist3")
If aDDL.SelectedIndex > 0 Then
Dim aTextBox = DetailsView1.FindControl("textbox5")
aTextBox.text = Now().ToString
End If
End If
End Sub


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Obadiah ChristopherCommented:
I think u should try doing it in the ItemCommand event.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.