- Mark I'm trying to understand how to respond to mode changing events in a Form View control.
Do I have to call the Change Mode() method in the Mode Changing event handler? I can see the mode in the process of changing, because my Mode Changing handler gets called, but then the Mode Changed handler never gets called. I didn't think to check whether Mode Changed was only called when using a Data Source ID-object.
I don't generally use Data Source ID-type objects, preferring a more "explicit" style of data binding.
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.
If I needed to switch the Data Source for the same control I had to do it elsewhere or come up with a scheme as the one mentioned earlier. Whenever an event fired that I wanted to change the viewmode for my form, I just store the right Form View Mode type in that object.
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.
I have to click Edit and Cancel twice for them to do their action.Because then I have to code those extra features that the Grid View and Details View have that the repeater does not.