jeudi 12 février 2015

Sorting by column heading in a grouped DVWP



I have created a data view in SharePoint Designer and applied 3 sorts, with the first one being a group function. Additionally, I have turned on the ability to sort by column heading.


When the page loads, everything is great. However, if you wish to re-sort by the column heading, it places that as the first sort, not second after the first sort/grouping.


Initial page load:



| Title | Column 1 | Column 2 | Date |
+ Date 2/11/2015
| item66 | BBB | 42 | 2/11/2015 |
| item42 | JJJ | 74 | 2/11/2015 |
+ Date 2/10/2015
| item34 | AAA | 99 | 2/10/2015 |
| item93 | CCC | 50 | 2/10/2015 |


The above example shows it is initially sorted decending by date, and grouped. Then Acending by Column 1.


If you click on Column 2 heading, this happens.



| Title | Column 1 | Column 2 | Date |
+ Date 2/11/2015
| item66 | BBB | 42 | 2/11/2015 |
+ Date 2/10/2015
| item93 | CCC | 50 | 2/10/2015 |
+ Date 2/11/2015
| item42 | JJJ | 74 | 2/11/2015 |
+ Date 2/10/2015
| item34 | AAA | 99 | 2/10/2015 |


When in reality I want it to keep the first sort and group by date, and apply the column sorting secondary.


If I insert this as a SharePoint list view, it works as I want. But to insert it as a data view it works like the above example.


Any ideas? Thanks








0 commentaires:

Enregistrer un commentaire