Multi Level Grouping in SharePoint List Programmatically

<SharePoint:ListViewByQuery ID="TestID" runat="server" />

In Code Behind: 


SPList oList = web.GetList("SampleList");
TestID.List = oList;
SPQuery query = new SPQuery(oList.DefaultView);

query.Query= "<GroupBy Collapse='FALSE'><FieldRef Name='Title' /><FieldRef Name='Subject' /></GroupBy>";
TestID.Query = query;

Hope this will helps you!!!

Happy coding....

Comments

Popular posts from this blog

IRM and the Object Model

This content database has a schema version which is not supported in this farm

Activate and Deactivate Feature through PowerShell