Friday 21 June 2013

Groupby choice column using dataview webpart

Groupby choice column using dataview webpart

Reference url: http://technology.feedfury.com/content/38130758-solved-can-t-group-by-choice-column-in-sharepoint-list-view.html

To group by a Choice field which allows multiple selections (checkboxes), convert the Web Part to a Data View using SharePoint Designer, then apply grouping doing the following: 1. From the "Common Data View Tasks" menu for the Data View Web Part, select "Sort and Group:" from the options to open the Sort and Group Dialog, add any field into the Sort Order section to activate the "Edit Sort Expression..." button. Click the "Edit Sort Expression..." button to open the Advanced Sort Dialog. 2. From the list of fields, add the Choice field, and make sure that the field reference is the only value in the "Edit the XPath expression" input. The field reference should begin with an @ symbol followed by the internal name of the SharePoint column/field (example: @Location). The value from the selected column will display in the Preview box if items in the list/library match the specified criteria, which in this case is a simple column/field value (no conditions or calculations required). 3. Press OK on to close the Advanced Sort Dialog. Select the Choice Field from the list of fields in the "Sort Order:" box, then select "Show Group Header" under Group Properties. This will result in items being grouped by the value in the choice field which allows multiple selections.
Steps to follow for  Dataview webpart (Ignore Above)

1)By defaultly list comes with xslt list view webpart (use allitems.aspx or create custom view for all items.aspx(make it as default view))

remove that xslt webpart-->goto insert add -->empty data view--> select datasource that list name--->

after that screen visible like this.in this select appropriate fields using ctrl button shown in the form(data source details)




After that select multiple field view from Insert select field as aashown in the above diagram

select the dtaview webpart and select the sort and group from the Options in Menu

it will show one popup from there select Add sort expression






Clixk on add and  select the choice field




Click on ok. Select group header after that(shown below)



after that it will show like below.if you want to enable insert, delete, edit, operations inside the form then select the options inside the inline editing






1 comment:

  1. This saved my bacon. Thank you for taking the time to put this together!!

    ReplyDelete