We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Groupping again

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>



4 Replies

RI Ricardo December 29, 2022 04:27 PM UTC

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();

                }

            }

        }



HN Harinath Navaneethakrishnan Syncfusion Team December 30, 2022 12:07 PM UTC

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:

https://www.syncfusion.com/feedback/40143/grouping-of-cardview-is-not-working-while-changing-the-itemsource-at-runtime


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




BA BagavathiPerumal Apranandham Syncfusion Team January 24, 2023 02:18 PM UTC

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.


Regards,

Bagavathi Perumal A




BA BagavathiPerumal Apranandham Syncfusion Team February 8, 2023 02:56 PM UTC

Hi Ricardo, 


We have included the fix for the reported issue “Grouping of cardview is not working while changing the itemsource at runtimein 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


Loader.
Up arrow icon