Dynamic MultiView asp.net

I have a page that dynamically creates GridViews based on user input, I would like to put each gridview in a "view" within a multiview so the page is not so cluttered.  I am not sure how to dynamically create a multiview with a menu so the user can "tab" between the views.  I understand how the controls work, I have never attempted to create it all manually before.  Any help would be greatly appreciated.  I am coding in C# asp.net 3.5.  Thank you for any help or guidance.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Richard LeeSoftware EnthusiastCommented:
The code below is a good start for you. It demonstrates how to dynamically create a MultiView, 2 Gridviews and add the dynamically created gridviews with bound data to the a view and then to the multiview.

You would need to have a PlaceHolder webcontrol named PlaceHolderContainer inside your markup.

var testData1 = new[]
						new { Id = 1, Name = "One"},
						new { Id = 2, Name = "Two"}
var testData2 = new[]
						new { Id = 3, Name = "Cow"},
						new { Id = 4, Name = "Horse"}

MultiView mv = new MultiView();
GridView gv1 = new GridView();
gv1.DataSource = testData1;

GridView gv2 = new GridView();
gv2.DataSource = testData2;

View v1 = new View();
View v2 = new View();


mv.ActiveViewIndex = 0;


Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
shanemayAuthor Commented:
Thank you for the response, that does put me on the right path, How might I add the menu to the multiview.  I can create the menu, I am just not sure how to associate it with the multiview.
shanemayAuthor Commented:
Thank you, that is what I needed.  I was able to get the menu attached as well.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.