We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Wizard: adding pages dynamically

Thread ID:

Created:

Updated:

Platform:

Replies:

35650 Oct 5,2005 08:01 PM Dec 27,2007 06:07 AM Windows Forms 6
loading
Tags: Tools
Administrator [Syncfusion]
Asked On October 5, 2005 08:01 PM

I am using the Wizard control from the Essential Suite 3.0.1.0 package. I am dynamically adding pages to the wizard, but i need to *insert* them, not just add them on the end of the collection, but the WizardContainer does not expose a method to insert them, only add. Is there a way this should be done? I want to avoid having to mess with the NextPage/PreviousPage properties as this is messy to do at run time, and is very hard to maintain.

Mano J [Syncfusion]
Replied On October 6, 2005 01:20 AM

Hi, There is no available methods to insert a wizard page. If you have to insert a wizard page, assign the NextPage and PreviousPage for that particluar page and insert it in the WizardPageCollection. Please refer to the code snippet below: private void Form1_Load(object sender, System.EventArgs e) { extraWizardControlPage = new Syncfusion.Windows.Forms.Tools.WizardControlPage(); extraWizardControlPage.Description = "This is the description of the extra Wizard Page"; extraWizardControlPage.Title = "Extra Page Title"; extraWizardControlPage.NextPage = this.wizardControlPage5; extraWizardControlPage.PreviousPage = this.wizardControlPage4; } // Add the page in the place where you want to insert in the Initialize component. this.wizardControl1.WizardPages = new Syncfusion.Windows.Forms.Tools.WizardControlPage[] { this.wizardControlPage1, this.wizardControlPage3, this.wizardControlPage4, // Insert the new page this.extraWizardControlPage, this.wizardControlPage5, this.wizardControlPage6 }; Please let me know if you have any questions. Thanks for using Syncfusion products. Regards, Mano

Administrator [Syncfusion]
Replied On October 6, 2005 04:31 PM

Hi Mano, thanks for the reply. I like the Wizard control, but it still has a few bugs and quirks which i need to work around. I have come up with another solution to this problem which i will share here in case it helps someone in the future. - in the designer i assign a TabIndex to all pages in the order they go in, leaving a gap in the numbering at the point where i want to insert pages - at run time create the dynamic page(s), assign them a TabIndex in the empty part of the range - after adding all dynamic pages, i do a sort on the WizardControlPage array at WizardControl.WizardPages, sorting the pages there in order of their TabIndex. Of course i should mention that this suits my needs because i have a linear flow of pages in the wizard, i don''t need to skip any, which means i can avoid using the NextPage/PreviousPage properties. Maybe you could submit a feature request to the developers for them to introduce an Insert function, because only having the Add is somewhat limiting. Regards, sluggy >There is no available methods to insert a wizard page. If you have to insert a wizard page, assign the NextPage and PreviousPage for that particluar page and insert it in the WizardPageCollection.

Bob Hogan
Replied On November 4, 2005 10:46 AM

The handling of NextPage and PreviousPage really seems to be kind of brain-damaged. A VERY common thing to do in a wizard is to change the flow of pages depending on the data entered on a page. The natural thing to do is to add all your pages to the WizardControl at initialization time, then dynamically modify the NextPage/PreviousPage according to THE NEEDS OF THE APPLICATION. But this appears to be almost impossible with Syncfusion''s WizardControl. At least I can''t seem to make it work. I get all kinds of weird page skipping behavior when I try to do this. I invite you to prove me wrong.

Mano J [Syncfusion]
Replied On November 7, 2005 09:34 AM

Hi Bob, Our wizard control uses WizardControlPage.NextPage and WizardControlPage.PreviousPage properties to arrange the sequence of WizardControlPages in the desired order. Regarding changing the wizard pages according to the datas entered on the pages, you could validate that page and set the desired page to be displayed when the next button is clicked. Please refer to the sample attached and let me know whether I have missed something. Regards, Mano test_wizard.zip

Asit Sinha
Replied On December 10, 2007 10:06 AM

Dear Sir,

I am facing a problem in WizardControl. According to the requirement, dynamic wizard page needs to be added in the wizard control but is not being shown after clicking the previous page.

Below is the wizard control code that I am using.

In this code, NewWizardControlpage is added and shown after the WizardControlPage4 next click, but this code isn’t working.

Please reply immediate.

Thanks & Regards,
Asit Sinha
(YSPL,Pune)


Code
Dim NewWizardControlPage As New Syncfusion.Windows.Forms.Tools.WizardControlPage
NewWizardControlPage = New Syncfusion.Windows.Forms.Tools.WizardControlPage(Me.components)
CType(NewWizardControlPage, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()

NewWizardControlPage.BackgroundColor = New Syncfusion.Drawing.BrushInfo
NewWizardControlPage.BorderColor = System.Drawing.Color.Black
NewWizardControlPage.BorderStyle = System.Windows.Forms.BorderStyle.None
NewWizardControlPage.Description = "New Page"
NewWizardControlPage.FullPage = False
NewWizardControlPage.LayoutName = "Card5"
NewWizardControlPage.Location = New System.Drawing.Point(0, 0)
NewWizardControlPage.Name = "NewWizardControlPage "
NewWizardControlPage.PreviousPage = WizardControlPage4
NewWizardControlPage.Size = New System.Drawing.Size(520, 446)
NewWizardControlPage.TabIndex = 14
NewWizardControlPage.Title = "Page Title"
WizardControlPage4.NextPage = Nothing
WizardControlPage4.NextPage = NewWizardControlPage

CType(NewWizardControlPage, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)

Me.WizardContainer1.Controls.Add(NewWizardControlPage)



Bhuvaneswari P [Syncfusion]
Replied On December 27, 2007 06:07 AM

Hi Asit,

Thanks for the update and code snippet:

Adding pages dynamically to the WizardControl

Please refer the below modified code snippet to do so:

VB

Dim temp As WizardControlPage = Me.wizardControl1.SelectedWizardPage
'Add new page
Dim wizPage As New WizardControlPage()
'Add the page into wizardcontrol
wizardControl1.AddPage(wizPage)
wizPage.Description = "This page is added at runtime"
wizPage.Title = "Dynamic Page"
wizPage.PreviousPage = Me.wizardControlPage5
wizPage.NextPage = Me.wizardControlPage1
Me.wizardControl1.SelectedWizardPage = temp

Please download the sample from the below location:
http://websamples.syncfusion.com/samples/Tools.Windows/F35650/main.htm

Please let me know if you have any other questions.

Best Regards,
Bhuvana


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;