Google
 

Tuesday, July 24, 2007

SharePoint 2007 - Group by vs Order in custom list view

I would like to create a custom list view to display in tree view (allow expand and collapse) and also want to specify ordering of each item myself.

But... the ordering sequence does not follow the setting. Item will order by Group Name which is text ordering.

I try to create a calculated column to concatenate of sequence (number type) with title.
It does not work because of Text ordering 10 is less than 2 !! ( 1, 10, 100, 2, 3 ,4 ,5)

Let create a situation that I mention above

1. at First, create a custom list with structure below

2. Enter data for testing like this.

3. Create a view and configure as following:-

View Name: Tree View
Sorting: Sequence
Group by: Display Name

4. Choose Tree View, you will get display like this, see !! it's wrong ordering !!!

Here is solution for this

1. Go to List Setting to modify calculated column formula

2. Use below formula to add white space at front of sequence number

=REPT(" ", 3-LEN(Sequence)) & Sequence &". "&Title

3. Go to refresh custom list view

4. here you go !!

No comments: