Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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!

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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