SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I created and deployed link list (default template (103)) from code and after that I added ListViewWebPart also from code which looks on default view of my link list. And that works.

Problem: How can i customize list from code so when i "load" that list in web part i get only reduced set of columns? For example (i want only "URL" column and not "Notes","Edit","Type" etc.. which i get default with "link list")

I assume that i should create new view on list(but I don't know how i can create view and stick it on list - from code) and than load that new reduced view in webpart OR somehow customize default view on web part. It's simple from designer, but any help how do that from code will be greatly appreciated.

share|improve this question
up vote 3 down vote accepted

Have a look at this post on MSDN which involves programmatically creating list views:

share|improve this answer
Thank you James. You are life saver!!! – trip Aug 25 '11 at 14:05

Your Answer


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.