StrataFrame Forum

Adding Wizard pages dynamically

http://forum.strataframe.net/Topic4701.aspx

By Greg McGuffey - 11/21/2006

I have a rather complicated wizard (simplifying a truly scary process) and I need to add pages to it dynamically. This I think I figured out, just use the Add method of the PagesCollection. However, can I set the position of the wizard page? I.e. insert before or after an existing page? Or change its position after it has been added? I don't see any methods or properties that would seem to indicate this can be done.



Second, some of the pages I'll be adding dynamically will be template pages that when I actually add them, I'll need to customize them based on some data. I'm assuming that just providing constructors with arguments to pass in the necessary data and then configure the template would work right?



Thanks!
By StrataFrame Team - 11/21/2006

You cannot change the index of a page once it has been added to the collection, but you can remove it and re-add it using the Insert() method of the WizardPageCollection class, so you can insert the page wherever you want.

As for templating your pages, yes it will work just fine... the pages are just panels with some extra properties.

By Greg McGuffey - 11/21/2006

Insert...that was what I was looking for. However, I might jump over to the enhancement area and make a request to allow reordering of wizard pages from the designer. Thanks!