Skip to content

Commit 56b9eb1

Browse files
committed
997111-Added UG content for Kanban KeepCard support
1 parent c96aaf3 commit 56b9eb1

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed

MAUI/Kanban-Board/Events.md

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,49 @@ public class KanbanViewModel
146146
* [`Cancel`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Kanban.KanbanDragStartEventArgs.html#Syncfusion_Maui_Kanban_KanbanDragStartEventArgs_Cancel) - Used to cancel the drag action.
147147
* [`Data`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Kanban.KanbanDragEventArgs.html#Syncfusion_Maui_Kanban_KanbanDragEventArgs_Data) - Used to get the underlying model of the card.
148148
* [`SourceColumn`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Kanban.KanbanDragEventArgs.html#Syncfusion_Maui_Kanban_KanbanDragEventArgs_SourceColumn) - Used to get the source column of card.
149-
* [`SourceIndex`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Kanban.KanbanDragEventArgs.html#Syncfusion_Maui_Kanban_KanbanDragEventArgs_SourceIndex) - Used to get the index of the card in source column.
149+
* [`SourceIndex`](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Kanban.KanbanDragEventArgs.html#Syncfusion_Maui_Kanban_KanbanDragEventArgs_SourceIndex) - Used to get the index of the card in source column.
150+
* `KeepCard` - Determines whether the original card remains in the source column during a drag operation. When set to true, the card stays in its original column while being dragged, allowing repeated drag-and-drop actions without relocating the card. A preview of the card is generated during the drag.
151+
152+
{% tabs %}
153+
154+
{% highlight xaml %}
155+
156+
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
157+
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
158+
x:Class="SimpleSample.MainPage"
159+
xmlns:kanban="clr-namespace:Syncfusion.Maui.Kanban;assembly=Syncfusion.Maui.Kanban"
160+
xmlns:local="clr-namespace:SimpleSample;assembly=SimpleSample">
161+
162+
<ContentPage.BindingContext>
163+
<local:KanbanCustomViewModel />
164+
</ContentPage.BindingContext>
165+
166+
<kanban:SfKanban x:Name="kanban" HorizontalOptions="FillAndExpand"
167+
VerticalOptions="FillAndExpand" ItemsSource="{Binding Cards}"
168+
DragStart="SfKanban_DragStart" >
169+
170+
...
171+
172+
</kanban:SfKanban>
173+
174+
</ContentPage>
175+
176+
{% endhighlight %}
177+
178+
{% highlight c# %}
179+
180+
SfKanban kanban = new SfKanban();
181+
kanban.ItemsSource = viewModel.Cards;
182+
kanban.DragStart += SfKanban_DragStart;
183+
184+
private void SfKanban_DragStart(object sender, Syncfusion.Maui.Kanban.KanbanDragStartEventArgs e)
185+
{
186+
e.KeepCard = true;
187+
}
188+
189+
{% endhighlight %}
190+
191+
{% endtabs %}
150192

151193
## DragEnd
152194

0 commit comments

Comments
 (0)