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(Detai lsView1.Ro ws.Item(?) )
3) Find my DDL
Dim aDDL as dropdownlist = CType(aDDL.cells(?).Findco ntrol("Dro pdownlist3 "0, dropdownlist)
If aDLL.selected IndexChanged then
Dim aTextbox as textbox = Ctype(detaislview.cells(?) .findcontr ol("Textbo x6", 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
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(Detai
3) Find my DDL
Dim aDDL as dropdownlist = CType(aDDL.cells(?).Findco
If aDLL.selected IndexChanged then
Dim aTextbox as textbox = Ctype(detaislview.cells(?)
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I think u should try doing it in the ItemCommand event.