You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: knowledge-base/dropdownlist-custom-sorting-order-groups.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
---
2
2
title: Custom Sorting Order for Groups in DropDownList
3
-
description: Learn how to apply a custom sorting order to groups in the DropDownList for Blazor.
3
+
description: Learn how to apply a custom order to groups in the DropDownList for Blazor.
4
4
type: how-to
5
-
page_title: How to Set a Custom Sorting Order for Groups in Blazor DropDownList
5
+
page_title: How to Set a Custom Grouping Order in Blazor DropDownList
6
6
slug: dropdownlist-custom-sorting-order-groups
7
7
tags: dropdownlist, blazor, telerik, grouping, custom order
8
8
res_type: kb
@@ -26,18 +26,18 @@ ticketid: 1666981, 1579415
26
26
27
27
## Description
28
28
29
-
I using the [grouping feature of the DropDownList]({%slug components/dropdownlist/grouping%}). My DropDownList model has a nested model. The DropDownList `GroupField` parameter is bound to the nested model property. I want the groups to appear in a non-alphabetical, custom order. How can I customize the group order in the DropDownList?
29
+
I am using the [grouping feature of the DropDownList]({%slug components/dropdownlist/grouping%}). My DropDownList model has a nested model as property. The DropDownList `GroupField` parameter is bound to a property of the nested model. I want the groups to appear in a non-alphabetical, custom order. How can I customize the grouping order in the DropDownList?
30
30
31
31
## Solution
32
32
33
-
To sort groups in a DropDownList by a custom order, perform a manual sorting operation in the [`OnRead` event]({%slug components/dropdownlist/events%}#onread) handler. Follow these steps:
33
+
To sort the groups in a DropDownList by a custom order, perform a manual sorting operation in the [`OnRead` event]({%slug components/dropdownlist/events%}#onread) handler. Follow these steps:
34
34
35
35
1. Create a list of strings that represents the values of the group headers. This list will determine the preferred sorting order.
36
36
2. Cast the [`DataSourceResult`]({%slug common-features-data-binding-onread%}#event-argument) to [`AggregateFunctionsGroup`](/blazor-ui/api/Telerik.DataSource.AggregateFunctionsGroup).
37
37
3. Sort the casted data using the [`Sort` method](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.list-1.sort?view=net-8.0) with a custom comparison function.
38
-
4. Pass the sorted data as `args.Data`({%slug common-features-data-binding-onread%}#todatasourceresult-method).
38
+
4. Pass the sorted data as [`args.Data`]({%slug common-features-data-binding-onread%}#todatasourceresult-method).
39
39
40
-
>caption Apply a sorting order to groups in the DropDownList
40
+
>caption Apply a custom grouping order in the DropDownList
0 commit comments