How can I make a view(SPView) with data will be filtered by filter condition form url parameter?
Example, I have some groups and some items belong to these group. Now, I want to list items of arbitrary group by url like http://sp2010/Lists/items.aspx?groupid=1.
I maked a SPView like
SPView view = SPList.DefaultView;
view.Query = "<Where>
<Eq> 开发者_高级运维 <FieldRef Name=\"Group\" LookupId=\"TRUE\"> <Value Type=\"Lookup\"><GetVar Name=\"GroupId\"></Value> </Eq> </Where>";view.Update();
It work on sharepoint 2007, but unfortunately it don't work on sharepoint 2010.
Try FilterField and FilterValue:
http://sp2010/Lists/MyList/AllItems.aspx?FilterField1=group&FilterValue1=Group%20Name
Note that the value of FilterField is the internal name of the field, not the display name.
精彩评论