Hi...
I had a requirement to change the default view programatically...
I tried so many code snippets, but it didnt work...
Finally i got the treat...
SPView myNewDefaultView = myList.Views["MyNewView"];
myNewDefaultView .DefaultView = true;
myNewDefaultView .Update();
myList.Update();
its really good to set
rootWeb.AllowUnsafeUpdates = true;
before you try this...
done.......
1 comment:
Good one. i searched almost everywhere to get the VIEW.UPDATE() statement right. Previously I was just updating the list after changing the view.defaultview = true.
Thanks a lot
Post a Comment