Controlling MultiView ActiveViewIndex after FormView Mode change

M

Martin

Hi,

I have a FormView control with a MultiView control within it's
EditItemTemplate (because using a Wizard doesn't maintain two way data
binding - MS confirmed bug).

Any how, I have the requirement to save my data every time I change view of
my MultiView control. So I call FormView.UpdateItem()

This works fine, except for having the side effect of putting the
FormView.CurrentMode back to ReadOnly.
So I handle FormView.ModeChanging, and set FormViewModeEventArgs.Cancel=true
to cancel the mode change.
This is fine, except my MultiView control is back in it's original view.
The last time I can see it, the AcitveViewIndex is what I require it to be,
but then it ends up being wrong.

I feel like I'm missing an event opportunity, or it's simply too late to do
anything about it.

Anyone know?

Thanks
Martin
 
M

Martin

Got it

protected void FormView1_ItemUpdated(object sender, FormViewUpdatedEventArgs
e)

{

e.KeepInEditMode = true;

}

protected void MultiView1_PreRender(object sender, EventArgs e)

{

if (IsPostBack)

((MultiView)sender).ActiveViewIndex = viewno;

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top