Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Programmatically Apply the filter to SharePoint List Default View
WhatsApp
Sagar Pardeshi
Jul 16
2014
6.6
k
0
0
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
Up Next
Programmatically Apply the filter to SharePoint List Default View