Start Onitemupdating detailsview

Onitemupdating detailsview

on the modechanging event ensure that you do the data Bind() last after you have set the change Mode or it will not take effect and will require the edit button to be pressed twice.

the above snippet should be changed like this: Just wanted to add my two cent for those still having this problem.

I seem to have a problem with mode changing when using my detailsview control. protected void Detail View_Mode Changing(object sender, Details View Mode Event Args e) Now, when I click on edit or insert and trace, the program hits the right event, but I have to hit the button twice for the control to change mode.

Even when it does change mode, regardless of which control I hit, the program will randomly decide if it is going to go into edit mode or update mode.

I am trying to gain access to a Drop Down List that is inside a "Insert Item Template", but the above code ends up with null. Thank the stars that you posted this - I was buggering around with this for ages and finally have a kind of work around. Then on the page prerender event I use the changemode method of my Form View object to change the viewmode to the one stored, and rebind.