This is a migrated thread and some comments may be shown as answers.

working with groups

1 Answer 33 Views
JumpList
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Vladimir
Top achievements
Rank 1
Vladimir asked on 04 Sep 2013, 07:14 PM
Hello!
I'm working on WP7  application  with  JumpList with grouping.
I group the records by city name, some records has empty City name, I group such items into a group "Without City".
Also I sort  groups asc or desc dynamicly.
And all working fine but I need that group "Without City" will be ALWAYS at the bottom of the list irrespective of the sorting
How could I do it?

GroupDescriptors = new List<
GenericGroupDescriptor<Person, string>>();
  
GenericGroupDescriptor<Person, string> group = new GenericGroupDescriptor<Person, string>();
group.SortMode = SortMode;
group.KeySelector = (person) =>
{
    return person.City == "" ? person.City :"Without City";
};
GroupDescriptors.Add(group);

1 Answer, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 09 Sep 2013, 11:24 AM
Hi Vladimir,

Thanks for writing.

You can try the following approach:

1. Sort the persons in your source collection by City so that everyone that has no City is positioned at the bottom of the collection.

2. Apply a group descriptor without sorting and return Without City for all items that have no city. Being at the end of the source should make that group be the last one created.

Let me know if you need further assistance with this.

Regards,
Deyan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINDOWS PHONE 7.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
JumpList
Asked by
Vladimir
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Share this question
or