views:

36

answers:

1

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.

A: 

Try FilterField and FilterValue:

http://sp2010/Lists/MyList/AllItems.aspx?FilterField1=group&amp;FilterValue1=Group%20Name

Note that the value of FilterField is the internal name of the field, not the display name.

Rich Bennema

related questions