# ListView Web Part Associated with List

Programmatically - How do I get to the listview web part associated with a list or library. I want to customize it and add it to a web page page in SharePoint 2013. I don't see it in the web part gallery.

Programmatically, you don't go and get the web part associated with a list. You add a XsltListViewWebPart to a page, and set its associated list to your list's ID.

For example (from this answer on this site) :

var documentsWP = new XsltListViewWebPart();
documentsWP.ListId = documentsList.ID

http://webapp/site/lists/listname/allitems.aspx

Once you have the URL you can open the file as a SPFile object. Then you can use SPLimitedWebPartManager to get the webparts on that page.