Wednesday, April 29, 2015

SharePoint 2010: Group by View with Order by on DateTime Field

First, lets have a look on what is the need to create this kind of view? To create Group by view, SharePoint provides out of box settings in Group by node in view setting where column to group by can be easily defined. With Group by view SharePoint shows its own behavior and it will do order by on the same column on which we have enabled Group by. Below is the simplest example to understand this.

Suppose we have a list named as 'Ask Us' with columns ‘Question’, ‘Answer’, ‘Created’, ‘Modified’. Now we want to show a list of questions in expandable-collapsible manner with ascending order on modified date. To achieve that i have selected a ‘Question’ column in group by setting and a ‘Modified’ Column in sort order settings so its output will be displayed with different sort order.

This is incorrect as per our requirement because we want to do order by on ‘Modified’ column not on ‘Question’ column.

To read the complete solution click on the link here

2 comments:

  1. Can you provide me your email address

    Thanks
    Shafi

    ReplyDelete
  2. Thanks for your article,

    Same script is not working for me in SP2013

    Can you please help me out asap

    ReplyDelete