Skip to content

Commit 412458f

Browse files
Merge pull request #1993 from syncfusion-content/991373-Sorting_Feature_UG_Correction
991373 - Update the sorting feature UG contents.
2 parents 5f54727 + 62adc8d commit 412458f

File tree

3 files changed

+19
-15
lines changed

3 files changed

+19
-15
lines changed
445 KB
Loading
449 KB
Loading

wpf/Kanban-Board/Sorting.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ documentation: ug
1111

1212
The Kanban control supports customizable card sorting within columns based on specific data fields such as `Priority`, `DueDate`, or `Status`. Sorting can be configured programmatically and updated dynamically at runtime using the following properties:
1313

14-
* `SortingMappingPath` - Used to map the sorting field to a property name in the `KanbanModel` or `CustomModel`. The default value is `string.Empty`, in which case the cards will not be sorted.
15-
* `SortingOrder` - Used to define the direction of cards sorting within each column.
16-
* `Ascending` - Cards with lower values appear first.
17-
* `Descending` - Cards with higher values appear first.
14+
* [SortingMappingPath](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Kanban.SfKanban.html#Syncfusion_UI_Xaml_Kanban_SfKanban_SortingMappingPath) - Used to map the sorting field to a property name in the [KanbanModel](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Kanban.KanbanModel.html) or `CustomModel`. The default value is `string.Empty`, in which case the cards will not be sorted.
15+
* [SortingOrder](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Kanban.SfKanban.html#Syncfusion_UI_Xaml_Kanban_SfKanban_SortingOrder) - Used to define the direction of cards sorting within each column.
16+
* [Ascending](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Kanban.KanbanSortingOrder.html#fields) - Cards with lower values appear first.
17+
* [Descending](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Kanban.KanbanSortingOrder.html#fields) - Cards with higher values appear first.
1818

19-
N> The `SortingOrder` property is applicable only when a valid value is assigned to `SortingMappingPath`.
19+
N> The [SortingOrder](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Kanban.SfKanban.html#Syncfusion_UI_Xaml_Kanban_SfKanban_SortingOrder) property is applicable only when a valid value is assigned to [SortingMappingPath](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Kanban.SfKanban.html#Syncfusion_UI_Xaml_Kanban_SfKanban_SortingMappingPath).
2020

2121
## Customize card order with sorting configuration
2222

@@ -27,7 +27,7 @@ Sorting in the Kanban control can be implemented using the following approaches.
2727

2828
### Custom Field Sorting
2929

30-
To enable custom sorting behavior, a valid property name from the `ItemsSource` must be mapped using the `SortingMappingPath` property. This mapping ensures that cards are loaded and repositioned based on the corresponding property value, allowing consistent sorting during both initialization and drag-and-drop operations.
30+
To enable custom sorting behavior, a valid property name from the [ItemsSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Kanban.SfKanban.html#Syncfusion_UI_Xaml_Kanban_SfKanban_ItemsSource) must be mapped using the [SortingMappingPath](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Kanban.SfKanban.html#Syncfusion_UI_Xaml_Kanban_SfKanban_SortingMappingPath) property. This mapping ensures that cards are loaded and repositioned based on the corresponding property value, allowing consistent sorting during both initialization and drag-and-drop operations.
3131

3232
This example demonstrates how card positions are updated based on sorting configurations and property mappings.
3333

@@ -64,13 +64,13 @@ This example demonstrates how card positions are updated based on sorting config
6464
<TextBlock Text="•"
6565
FontSize="14"
6666
FontWeight="Bold"
67-
Foreground="Orange"
67+
Foreground="#FF0000"
6868
VerticalAlignment="Center"
6969
HorizontalAlignment="Center" />
7070
<TextBlock Text="{Binding Priority}"
7171
FontSize="14"
7272
FontWeight="Bold"
73-
Foreground="Orange"
73+
Foreground="#003366"
7474
VerticalAlignment="Center"
7575
HorizontalAlignment="Left"
7676
Height="20" />
@@ -153,18 +153,20 @@ public class SortingViewModel
153153
public ObservableCollection<CardDetails> Cards { get; set; }
154154
}
155155

156-
N>
157-
* To apply sorting after a drop operation, handle the `CardDragEnd` event and explicitly call the `RefreshKanbanColumn` method. This ensures the column updates to reflect the new card order based on the defined sorting logic.
158-
* When using a custom data model, the default card UI is not applicable. To render the card content, you must define a custom `DataTemplate` using the `CardTemplate` property.
159-
160156
{% endhighlight %}
161157
{% endtabs %}
162158

159+
![custom-field-sorting-in-wpf-kanban](SfKanban_images/custom-field-sorting-in-wpf-kanban.gif)
160+
161+
N>
162+
* To apply sorting after a drop operation, handle the [CardDragEnd](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Kanban.SfKanban.html#Syncfusion_UI_Xaml_Kanban_SfKanban_CardDragEnd) event and explicitly call the [RefreshKanbanColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Kanban.SfKanban.html#Syncfusion_UI_Xaml_Kanban_SfKanban_RefreshKanbanColumn_System_String_) method. This ensures the column updates to reflect the new card order based on the defined sorting logic.
163+
* When using a custom data model, the default card UI is not applicable. To render the card content, you must define a custom `DataTemplate` using the [CardTemplate](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Kanban.SfKanban.html#Syncfusion_UI_Xaml_Kanban_SfKanban_CardTemplate) property.
164+
163165
### Index-Based Sorting
164166

165167
The index-based approach in the Kanban control allows cards to be dropped at precise positions within a column. Upon dropping, the card's index is updated based on the index of the previous card. Additionally, the index of the next card is incremented relative to the drop position to maintain continuous ordering.
166168

167-
N> The `SortingMappingPath` property must be mapped to a valid numeric property name from the `ItemsSource` to enable index-based sorting updates.
169+
N> The [SortingMappingPath](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Kanban.SfKanban.html#Syncfusion_UI_Xaml_Kanban_SfKanban_SortingMappingPath) property must be mapped to a valid numeric property name from the [ItemsSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Kanban.SfKanban.html#Syncfusion_UI_Xaml_Kanban_SfKanban_ItemsSource) to enable index-based sorting updates.
168170

169171
The following code example illustrates how cards numeric property updated using the index-based sorting approach.
170172

@@ -505,6 +507,8 @@ public class SortingViewModel
505507
{% endhighlight %}
506508
{% endtabs %}
507509

510+
![index-based-sorting-in-wpf-kanban](SfKanban_images/index-based-sorting-in-wpf-kanban.gif)
511+
508512
N>
509-
* The Index-based sorting can be achieved at the sample level after a drag-and-drop action. To implement this handle the `CardDragEnd` event, access the items in the target column using `e.TargetColumn.Items`, and update the numeric field used for sorting to maintain a continuous order. Finally, call `RefreshKanbanColumn` method to update the UI with the new order.
510-
* To disable sorting logic, avoid assigning a value to the `SortingMappingPath` property. This ensures that card positions remain static and reflect the order of the `ItemsSource` collection, making it suitable for scenarios where sorting is not required or is managed externally.
513+
* The Index-based sorting can be achieved at the sample level after a drag-and-drop action. To implement this handle the [CardDragEnd](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Kanban.SfKanban.html#Syncfusion_UI_Xaml_Kanban_SfKanban_CardDragEnd) event, access the items in the target column using `e.TargetColumn.Items`, and update the numeric field used for sorting to maintain a continuous order. Finally, call [RefreshKanbanColumn](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Kanban.SfKanban.html#Syncfusion_UI_Xaml_Kanban_SfKanban_RefreshKanbanColumn_System_String_) method to update the UI with the new order.
514+
* To disable sorting logic, avoid assigning a value to the [SortingMappingPath](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Kanban.SfKanban.html#Syncfusion_UI_Xaml_Kanban_SfKanban_SortingMappingPath) property. This ensures that card positions remain static and reflect the order of the [ItemsSource](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Kanban.SfKanban.html#Syncfusion_UI_Xaml_Kanban_SfKanban_ItemsSource) collection, making it suitable for scenarios where sorting is not required or is managed externally.

0 commit comments

Comments
 (0)