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

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

1 Answer 1

up vote 3 down vote accepted

Have a look at this post on MSDN which involves programmatically creating list views: http://blogs.msdn.com/b/sowmyancs/archive/2008/03/15/programmatically-create-a-view-custom-view-of-a-list-and-change-the-view.aspx

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

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.