This can be achieved very easily using SharePoint Designer 2010. Here are the steps to do this:
1. Create a view with all the fields which you need and also put a group by clause with any field available. This will generate all the code in the View file. I have updated the All Items view and grouped the items by one field.
2. Open the List in SharePoint Designer 2010 and open the view in which you need to modify this grouping. I am using the All Items view so I will make the changes in Allitems.aspx.
3. Locate the code which mentions the
4. Edit the field for this and put it as:
5. Your final code will look like this:
<View Name="{A1737F54-FE3E-4527-81B9-51C58813F33B}" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" Type="HTML" DisplayName="All Items" Url="/Lists/DepartmentList/AllItems.aspx" Level="1" BaseViewID="1" ContentTypeID="0x" ImageUrl="/_layouts/images/generic.png"> <Query> <GroupBy Collapse="TRUE" GroupLimit="30"> <FieldRef Name="ContentType"/> </GroupBy> <OrderBy> <FieldRef Name="ID"/> </OrderBy> </Query>
No comments:
Post a Comment