SPView change columns programmatically

I created a little webpart and use ToolPaneView=2 to place it on thelist page of the view in which I am attempting to edit. It lets youchoose which columns should be shown. When using view.ViewFields.Delete(col name) then view.Update() nothing happens to the view even afterrefreshes. Can I not programmatically edit the views that are createdusing the built in form?

Share:

2 Answers Found

If Iâm reading this correctly youâre changing a view after a ListViewWebPart has been created from it. If thatâs the case then thereâs a special hidden view that itâs using to display the data. If you can get to that view you should be able to update the display. You can get the DWP for a ListViewWebPart (itâs broken in the user interface but not from the API). From there you can extract the GUID for the view that it uses.

The views that are created are based upon the underlying list definitionin the site definition. I believe that most of these lists are hot spotsin the list definition. So, you should be able to immediately see (afteran iisreset) any change you make to the built-in views.

Go4Sharepoint, is a Microsoft Featured Community.
Microsoft, Windows, Sharepoint, Sharepoint logo, Windows logo, etc are trademarks of the Microsoft Corporation.
All product names, logos, copyrights, and trademarks mentioned are acknowledged as the registered intellectual property of their respective owners. This site is not in any way affiliated with, nor has it been authorized, sponsored, or otherwise approved by, Microsoft Corporation.