Hello!
I have the next code:
private void loadReminders()
{
cvReminders.ItemsSource = new ListCollectionView(expirationsRemindersService.getAllWithGeneration()?.Where(x => x.done != true).ToList());
cvReminders.CanGroup = true;
cvReminders.GroupCards("groupDate");
}
this function is called when i want refresh the card view, but the grouping is lost when i call the second time. the xaml is the next:
<syncfusion:CardView x:Name="cvReminders" ShowHeader="false" Orientation="Horizontal">
<syncfusion:CardView.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding transactaionsReminders.person.name}"/>
</DataTemplate>
</syncfusion:CardView.HeaderTemplate>
<syncfusion:CardView.ItemTemplate>
<DataTemplate >
<ListBox ScrollViewer.HorizontalScrollBarVisibility="Disabled">
<ListBoxItem Padding="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="75" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="Fecha:" />
<TextBlock Grid.Column="1"
Text="{Binding date, StringFormat='{}{0:dd/MM/yyyy}'}" />
</Grid>
</ListBoxItem>
<ListBoxItem Padding="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="75" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<TextBlock Text="Categoría:" />
<TextBlock Grid.Column="1"
Text="{Binding transactaionsReminders.category.description}" />
</Grid>
</ListBoxItem>
<ListBoxItem Padding="1">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="75" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<TextBlock Text="Importe:" />
<TextBlock Grid.Column="1"
Text="{Binding transactaionsReminders.amount,ConverterCulture='es-ES', StringFormat='{}{0:C}'}" />
</Grid>
</ListBoxItem>
</ListBox>
</DataTemplate>
</syncfusion:CardView.ItemTemplate>
</syncfusion:CardView>
I did one solution but it's nothing elegant, for the moment work:
private void loadReminders()
{
//TODO: Evitar error al volver al cargar que no agrupa, ahora no esta del todo como me gustaria
if (cvReminders.ItemsSource == null)
{
cvReminders.ItemsSource = new ListCollectionView(expirationsRemindersService.getAllPendingWithoutFutureWithGeneration());
cvReminders.CanGroup = true;
cvReminders.GroupCards("groupDate");
cvReminders.Items.SortDescriptions.Clear();
cvReminders.Items.SortDescriptions.Add(
new System.ComponentModel.SortDescription("date", System.ComponentModel.ListSortDirection.Ascending));
}
else
{
while (((ListCollectionView)cvReminders.ItemsSource).Count > 0)
{
((ListCollectionView)cvReminders.ItemsSource).RemoveAt(0);
}
foreach (ExpirationsReminders expirationsReminders in expirationsRemindersService.getAllPendingWithoutFutureWithGeneration())
{
((ListCollectionView)cvReminders.ItemsSource).AddNewItem(expirationsReminders);
((ListCollectionView)cvReminders.ItemsSource).CommitNew();
}
}
}
Hi Ricardo,
We have confirmed the reported scenario is a defect and logged a report for the reported scenario “Grouping of cardview is not working while changing the itemsource at runtime”. We will include the fix in our upcoming Weekly NuGet release which is scheduled on 24th January 2023.
You can track the status of this defect using
the following feedback link:
If you have any more specification replication
procedures or a scenario to be tested, you can add it as a comment in the
portal.
Please let us know if you need any further
assistance.
Note: The provided feedback link is private, and you need to log in to view this feedback.
Regards,
Harinath N
Hi Ricardo,
Sorry for the inconvenience,
We are still working on this issue with high priority. We are unable to include this fix in our upcoming 2022 Volume 4 SP Release. We will update the fix in our upcoming NuGet release which is scheduled on 07th February 2023. We will appreciate your patience until then.
Bagavathi Perumal A
Hi Ricardo,
We have included the fix for the reported issue “Grouping of cardview is not working while changing the itemsource at runtime” in our Weekly NuGet release version 20.4.0.49 which is available for download (https://www.nuget.org/).
We thank you for your support and appreciate your patience in waiting for this
update. Please get in touch with us if you require any further assistance.
Regards,
Bagavathi Perumal A