Select a view for Document Library web part

With MOSS 2007, after inserting a document library web part, you can select a specific view to use for this web part (same for other list web parts).

However I found that once the web part is created, the changes made to that view will not be automatically reflected in the web part. You have to go back to the edit properties window of the web part and re-select the view. It looks like the web part creates a local “instance” of the view definition.

Advertisements
This entry was posted in Document library, Webpart and tagged . Bookmark the permalink.

5 Responses to Select a view for Document Library web part

  1. aboutdev says:

    I’ve been looking deeper inside the ListViewWebPart and its kinda interesting how it works. If you open a page with SharePoint Designer and look the xml, you will see a lot of CAML in there. I believe this is the “local instance” you are referring to. So in theory, once you have attached the view to the Web Part and saved it, you can open it back up again and modify the View’s CAML code inside the Web Part in order to modify behavior and/or the way it displays.

    There is one issue I have seen with this web part that has dumbfounded me. If you have a document library with folders in it, and a web part page that takes in a Query String such as Folder=Project345 (and Project345 is a folder in the library), how can you make sure that the Web Part only displays that folder’s contents.

    I spend quite a while on trying to figure that one out but unfortunately, I can’t find a solution (MS Support was no help either). If you have any ideas, I’d love to know what you think.

    Thanks.
    Sushant Bhatia

  2. Francois H. Pienaar says:

    Hi,

    Any modifications to a view via options (List Settings in MOSS 2007 and Modify Settings and Columns in SPS 2003) will only reflect once the view is reapplied to the web part.

    This has always been the case.

    http://technicallead.wordpress.com

  3. nita says:

    Hi,
    I wonder if you have encountered this scenario, but you can creat more than 50 views for a document library, but in the webpart properties, it lists out only 50 views. Would you know how to set this right? any work arounds?

  4. Knox says:

    Nita, this is a known limitation (only 50 views will be shown). We raised it with MS support, and they fix it in the next version.

  5. Fantastic blogpost, I didn’t thought reading it was going to be so cool when I klicked at the url!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s