The underlying collection "lstEquation.DataSource" does not change when I drag and drop the order of items within SFListView. I have used UpdateSource=True.Not sure if I am using it right, though.
Here's my xaml code:
UpdateSource="True">
Here's my .cs code:
private void LstEquation_ItemDragging(object sender, Syncfusion.ListView.XForms.ItemDraggingEventArgs e)
{
if (e.Action == Syncfusion.ListView.XForms.DragAction.Drop)
{
for (int i = 0; i < EquationComponents.Count; i++)
EquationComponents[i] = lstEquation.DataSource.Items[i]; //DataSource does not change at all //even after reordering through drag //and drop
}
}
Any help would be appreciated. Thanks.
<syncfusion:SfListView x:Name="ToDoListView" ItemSize="60" IsStickyHeader="True" ItemsSource="{Binding ToDoList}" DragStartMode="OnHold,OnDragIndicator" SelectionMode="None">
<syncfusion:SfListView.DragDropController>
<syncfusion:DragDropController UpdateSource="True"/>
</syncfusion:SfListView.DragDropController> |
private void ListView_ItemDragging(object sender, ItemDraggingEventArgs e)
{
if (e.Action == DragAction.Drop)
{
Device.BeginInvokeOnMainThread(() =>
{
var items = (ListView.BindingContext as ViewModel).ToDoList;
});
}
} |