Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / June 2006

Tip: Looking for answers? Try searching our database.

Controlling MultiView ActiveViewIndex after FormView Mode change

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Martin - 27 Jun 2006 15:47 GMT
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
Martin - 27 Jun 2006 16:09 GMT
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;

}

> Hi,
>
[quoted text clipped - 20 lines]
> Thanks
> Martin

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.