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();

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


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


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


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.