This question is locked. New answers and comments are not allowed.
While SortDescriptors specify how to sort the items within the JumpList, is there a way i could specify how to sort the groups.
For example:
a
1,2,3
x
4,5,6
b
1,4,5
How can I specify I need my groups to be displayed in the order {a, x, b}?
For example:
a
1,2,3
x
4,5,6
b
1,4,5
How can I specify I need my groups to be displayed in the order {a, x, b}?
7 Answers, 1 is accepted
0
Hello Vivek,
Yes, there is a way to implement this scenario. One possible way would be to first sort the items by using the key that you will later group by. In this way the groups will be created in the order the items were sorted initially and you will get the desired result. When sorting, you will also need to implement the IComparable interface in your business objects and provide the proper comparison logic so that you make x<b.
Let me know in case you have further questions or need assistance.
Regards,
Deyan
the Telerik team
Yes, there is a way to implement this scenario. One possible way would be to first sort the items by using the key that you will later group by. In this way the groups will be created in the order the items were sorted initially and you will get the desired result. When sorting, you will also need to implement the IComparable interface in your business objects and provide the proper comparison logic so that you make x<b.
Let me know in case you have further questions or need assistance.
Regards,
Deyan
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Eugene
Top achievements
Rank 1
answered on 28 Jan 2014, 10:23 PM
Reviving an old post.
So the item sorting solution would work if the items never move within groups. In my case, I actually have a case where the items may move from one group to another, and I need the groups sorted. How would I implement that?
So the item sorting solution would work if the items never move within groups. In my case, I actually have a case where the items may move from one group to another, and I need the groups sorted. How would I implement that?
0
Hi Eugene,
Your group descriptors should have a SortMode property. You can set it to make sure that your groups are always sorted in some order.
Please write again if you have other questions.
Regards,
Victor
Telerik
Your group descriptors should have a SortMode property. You can set it to make sure that your groups are always sorted in some order.
Please write again if you have other questions.
Regards,
Victor
Telerik
If you want to get updates on new releases, tips and tricks and sneak peek previews directly from the developers working on the UI for Windows Phone, subscribe to the blog feed now.
0
Eugene
Top achievements
Rank 1
answered on 03 Feb 2014, 08:35 AM
SortMode only allows Ascending or Descending, from what I can tell. Really, a GroupDescriptor should be derived from IComparable<GroupDescriptor>, and allow overriding of the Compare operator. That would be a more .NET way of structuring this API.
But short of that, any other solutions?
Thanks!
But short of that, any other solutions?
Thanks!
0
Hello Eugene,
Actually sorting can be either ascending or descending. The groups in either case are sorted based on the value of the group key. So, if you want to have custom sorting approach, you can define a generic group descriptor that returns a composite object instead of a string for the group key. That composite object implements IComparable and overrides Equals. If you have some code to share I can help you by implementing this for you.
Hope this helps.
Regards,
Deyan
Telerik
Actually sorting can be either ascending or descending. The groups in either case are sorted based on the value of the group key. So, if you want to have custom sorting approach, you can define a generic group descriptor that returns a composite object instead of a string for the group key. That composite object implements IComparable and overrides Equals. If you have some code to share I can help you by implementing this for you.
Hope this helps.
Regards,
Deyan
Telerik
If you want to get updates on new releases, tips and tricks and sneak peek previews directly from the developers working on the UI for Windows Phone, subscribe to the blog feed now.
0
Asdrúbal
Top achievements
Rank 1
answered on 14 Apr 2014, 10:46 PM
Hi,
The composite object + IComparable + override Equals works great for custom sorting group descriptor!
But... now I having this problem, I the base.ToString() text of the composite Object in design mode, not the overridden ToString() for the class
Dont get me wrong, It works great at run time, its in design mode the problem (Blendability issues)
Thanks
The composite object + IComparable + override Equals works great for custom sorting group descriptor!
But... now I having this problem, I the base.ToString() text of the composite Object in design mode, not the overridden ToString() for the class
Dont get me wrong, It works great at run time, its in design mode the problem (Blendability issues)
Thanks
0
Hi Asdrubal,
You can perform a check to see if your component is currently in design mode or not:
Regards,
Deyan
Telerik
You can perform a check to see if your component is currently in design mode or not:
if
(DesignerProperties.GetIsInDesignMode(
this
))
{
// Design-mode specific functionality
}
Regards,
Deyan
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.