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

Documentation RadJumpList

8 Answers 172 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.
Thore
Top achievements
Rank 1
Thore asked on 16 Sep 2011, 11:12 PM
I'm really struggeling with the group headers in the RadJumpList. The only documentation I have found is in the Windows Phone blog, but even that is really thin. Is there more documentation somewhere?

8 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 19 Sep 2011, 07:47 AM
Hi Thore,

Thanks for writing and for your feedback.

Please let us know what you are trying to achieve so that we can better assist you. Also, in this way we will be able to evaluate what is missing in the documentation and make sure we update it accordingly.

Thanks for your time.

Best wishes,
Deyan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Thore
Top achievements
Rank 1
answered on 19 Sep 2011, 07:33 PM

Hi,

I'm working on app where I have a datalist I want to display in a JumpList grouped on a date field. This is pretty straight forward using the GenericGroupDescriptor class.

But the group texts are only displayed as dates, for example "10/2/2011". I want to customize this text. For example I want to display "Today" when the date in the dataset is today, or "Christmas day" when the date is christmas day etc.

The Telerik To Do app is an example of such a app. (Nice app by the way. I use it every day.). I have looked at the code, but i really don't understand this code. It is a oneliner with a Mix of Telerik and Sterling DB code (I think..).

 I have made a modified version of the Telerik DataOperations example. I have added a ReleaseDate to the Movie class. I group the collection on the ReleaseDate (Makes no sense, I know..). Could you walk me through how I can modify the group texts to for example "Today", "Tomorrow" etc in my modified version.

I could mail You the example if you want that.

Regards
Thore 

0
Deyan
Telerik team
answered on 20 Sep 2011, 11:32 AM
Hi Thore,

Thanks for writing back and for the requested details.

The easiest way to modify the appearance of the text inside the group header is to use the GroupFormatString property defined on GenericGroupDescriptor. In this way you will be able to display not only the key you are grouping by, but a string containing additional information, as well as the key. Something like:

"Start date: 09/19/2011"

for instance. This is achievable by defining a GroupFormatString as follows:

"Start date: {0}"

Depending on the date, you can define different group format strings and thus implement the functionality which either displays Today or Christmas day.

Since you also mention the Telerik  Tasks application, I will shed some light on how the grouped tasks view on the home panorama is implemented. In this scenario a GenericGroupDescriptor is used which defines a key selector with more extended logic. For instance, in our case we group the tasks in groups called Today, Tomorrow and Next. In this scenario, the key selector defined as a lambda on the GenericGroupDescriptor takes the value of the task's due date, calculates the group in which the task fits (today, tomorrow or next) and returns a string representing the group title: Today, Tomorrow or Next. In this way tasks are inserted into groups according to their due date.

I hope this is helpful. We will make sure to extend our online help with some custom scenarios so that more of our customers have access to the information.

Let me know if you need further assistance on this.

Regards,
Deyan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Thore
Top achievements
Rank 1
answered on 20 Sep 2011, 12:06 PM
Thank you for your answer.

Im not sure if I understand exactly how this is done. So it would be very nice if you could give me a small code sample for each approach.
I think future user also would like that in your documentation. Actually it is simple samples I would like to see more of in your documentation.

Regards
Thore
0
Deyan
Telerik team
answered on 20 Sep 2011, 02:47 PM
Hello Thore,

Thanks for writing back.

I have prepared a small Windows Phone 7 application that demonstrates the approaches I have discussed earlier in this thread.

Take a look at the source code of MainPage.xaml where I have defined two methods. Each method creates a list of data objects (in this case instances of a dummy class called MyTask) and initializes their properties with data. Then the method creates a GenericDataDescriptor, defines a key selector and adds the descriptor to the GroupDescriptors collection. After that, the RadJumpList control is bound to the list of data items.

The first method,

PerformTodayTomorrowNextGrouping

groups the items in the JumpList based on their DueDate by generating a key selector depending on how the corresponding DueDate compares to DateTime.Now.

The second method,

PerformGroupingWithGroupHeaderFormatting

groups the items in the JumpList based on their DueDate (disregarding the time part of the DateTime struct). This method also sets the GroupFormatString property of the GenericGroupDescriptor class to define the string that will appear in the corresponding group header.

In MainPage.xaml you can see that I have defined an ItemTemplate and GroupHeaderTemplate for RadJumpList.

I hope this example will help you understand both scenarios.

You can write back anytime you have further questions or need assistance.

All the best,
Deyan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Thore
Top achievements
Rank 1
answered on 20 Sep 2011, 02:51 PM
Oh! That's fantastic!
I will look at your demo tonigth.

Thanks!
Thore

0
Thore
Top achievements
Rank 1
answered on 20 Sep 2011, 09:03 PM

Hi,

Thanks again! This was what I wanted!

However I found a problem, at least it was a problem for me. Both list are now sorted on the new groupheader texts.

In the list with the "Today", "Tomorrow" and "Next" header texts the groups was sorted like this:

"Next"
"Today"
"Tomorrow"

In other words it was sorted alfabetically in groupheader text order. What I wanted was this:

"Today"
"Tomorrow"
"Next"
 

The fix to this was quite simple.

In both examples I added som code before and after this line:

    GenericGroupDescriptor<MyTask, DateTime> gd = new GenericGroupDescriptor<MyTask, DateTime>();

Here is the code as I modified it:

           GenericSortDescriptor<MyTask, DateTime> sortBy = new GenericSortDescriptor<MyTask, DateTime>(task => task.DueDate);
            this.radJumpList.SortDescriptors.Add(sortBy);

            GenericGroupDescriptor<MyTask, DateTime> gd = new GenericGroupDescriptor<MyTask, DateTime>(); // <- The original line
            gd.SortMode = ListSortMode.None;
   
Then I got the sorting I wanted. (The "Formatted Group Headers" exampel is sorted on in the expected order, but that is simply because the where sorted "by default").  I found this solution in your TelerikToDo app.

Regards
 Thore

0
Deyan
Telerik team
answered on 21 Sep 2011, 07:49 AM
Hello Thore,

Yes indeed, you have found the right way to sort the groups according to your requirements.

For now, I will consider this thread closed.

You can write back anytime you have further questions or need assistance.

Kind regards,
Deyan
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
JumpList
Asked by
Thore
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Thore
Top achievements
Rank 1
Share this question
or