TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Programmatically Apply the filter to SharePoint List Default View
Sagar Pardeshi
Jul 16
2014
Code
6.5
k
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
string
tempQuery=
"<Where><Eq><FieldRef Name=\"Title\"/>"
+
"<Value Type=\"Text\"
>xyz</Value></Eq></Where>;
SPList listView= oWeb.Lists[listName];
for
(
int
i = 0; i < listView.Views.Count; i++)
{
//Get the view
SPView view = listViewActual.Views[i];
if
(view.DefaultView)
{
oWeb.AllowUnsafeUpdates =
true
;
view.Query = tempQuery;
view.Update();
oWeb.AllowUnsafeUpdates =
false
;
}
}
SharePoint List Default View