I have a standard list in Sharepoint 2010. The list has a standard view, but technically the view could even be custom built.
Is it possible for me to pass through a CAML query from a web part I've built, to filter results in the view?
I intend to implement a tree nav web part, that will filter items - very much in the same way managed metadata filtering works.
I'll need to do recursive lookups so the CAML could end up being "fun". But CAML is pretty good performance wise, so mainly is it possible to get the CAML to the view, so that it filters efficiently?
Thanks in advance!
EDIT: If this is possible, just just a quick hint where the code would go. I've managed to track down this :
SPWeb web = SPControl.GetContextWeb(this.Context);
SPView view = web.Lists["List Name"].Views["Search"];
view.Query = query;
view.Update();
But I guess this would need to be placed inside the view aspx code. Because it would be dynamic each time the view is requested.