Showing posts with label SharePoint. Show all posts
Showing posts with label SharePoint. Show all posts

23 January 2009

Using the Multi-View Control

I had a student the other day who had need of this, and I had to dig it out of the far reaches of my memory (I don't do a lot of individual page/report design work). But It's pretty useful, so I thought I'd toss it out there for everyone else.

There are times when you want to have a lot of information easily accessible on a page within your SharePoint site, but there's too much to put on a single page for whatever reason (not enough screen real estate, visual layout is too cluttered etc.).

There are quite a few ways of coping with this, ranging from creating separate pages to using filters and audience targeting and all sorts of other options. I have found using the MultiView control to be useful, especially when building reports and dashboards.

The MultiView control allows you to create multiple views, putting whatever information and web parts in those views you like and then use navigation controls to switch between them. One gotcha--at a bare minimum you will need to use SharePoint Designer to edit the page that use the controls. Below is a very basic primer on how to create a MultiView section, create the views inside it and use links/buttons to provide some navigation. Keep in mind there are other ways to provide the navigation, but I'm not trying to be comprehensive. I'm going for quick and easy here.

1. Open/create the .aspx page you want to put the control into with SharePoint Designer.

2. Locate the space where you want to put the views.

3. From the "Standard" group in the ASP.NET Controls in the Toolbox, add the MultiView control into that space you identified in Step 2.

4. In the properties for the MultiView control, locate the "ActiveViewIndex" property and set it to 0 (zero). This will display the first view you create. The default value is "-1" which makes all the views hidden.

5. In the white space of the MultiView control, add the number of View controls you need (1 for each view. You will find the View control in the same group as the MultiView control in the Toolbox. The only thing that can be put into the MultiView control are View controls.

6. Each View has an "ID" property that should be set, and will need to be unique with in the set of views for the MultiView control. The default will probably read something like "View1". A more informative name is probably useful.

7. Each View on your page should have some space to insert controls and web parts. This is where you will put your tables/web part zones/web parts/whatever you want in that view.

8. As part of each view you may choose to put your navigation buttons/links. By putting them inside the views, you can make easy use of the builtin properties and methods for navigation that are available to you. There are ways to manage the navigation from outside the MultiView control and the Views, but they are more complex to implement and will require more coding.

9. In each view a Button or LinkButton control for each view. (i.e if you have 3 views inside the MultiView, add three buttons). You may choose to do this once and then copy/paste from one view into the others.

10. For each button, adjust the following properties:
Text: Name of the View the button is going to switch to
CommandName: SwitchViewByID
CommandArgument: ID (the property you set) of the View the button is going to switch to

11. Once complete, save your work and preview the page.

29 January 2008

Mastering WSS 3.0 is here

C A Callahan's book on WSS has finally dropped. Woohoo!!

Those of you who know me might remember that contributed to that effort. I'm really thrilled to be a part of it, and thrilled for Callahan.

If you want to know anything about WSS 3.0 go check it out here.

And if you want any supporting information, check out Callahan's WSS 3.0 blog, complete with podcasts here.

I hope everyone is having a good January.

Cheers,
James