3

The ListView Webpart is a component created to show a list inside a page... It's very usefull and easy to use... The way to create a ListViewWebPart and set a list is very simple:

        myListView = new Microsoft.SharePoint.WebPartPages.ListViewWebPart();
        myListView.Visible = true;
        myListView.EnableViewState = true;
        SPList list = oWebSite.Lists[listName];
        myListView.ListName = list.ID.ToString("B").ToUpperInvariant();
        myListView.TitleUrl = list.DefaultViewUrl;
        myListView.WebId = list.ParentWeb.ID;
        myListView.ListId = (System.Guid)list.ID;
        myListView.ViewGuid = list.DefaultView.ID.ToString("B").ToUpperInvariant();
        Controls.Add(myListView);

When i click on a folder inside the webpart it redirect me to an url like this:

http://sp2010dev/SitePages/Home.aspx?RootFolder=%2fdocs%2fiuihuoho&FolderCTID=&View=%7b9EE11E87%2dEF54%2d48B9%2dB386%2d24DFB4B36C42%7d

In wich Sharepoint sets the folder to access... Is it possible to set that folder programmatically without using the RootFolder parameter? And a way to avoid the "reading" of the query string if i want to force the list to my orders?

Anybody knows a way? Thank you very much!

1 Answer 1

0

If I understand your question correctly, I did this before using this example:

http://www.sharepointconfig.com/2010/11/displaying-files-from-a-specific-folder-using-spdatasource/

I hope that helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.