SfRating disappering when in ListView and Scrolled

I have a ListView (normal Xamarin.Forms Listview) with a DataTemplate/ViewCell/Grid which contains a SfRating. When I scroll the Listview, the items which "leave" the display are "losing" their SfRatings -> The SfRatings disappear.


Affected platform: Android


I think the screenshots will provide better insight.


Attachment: Screenshots_aa6ce5a3.zip


1 Reply 1 reply marked as answer

SS Suganya Sethuraman Syncfusion Team March 30, 2022 12:44 PM UTC

Hi Biss-Fotec,

We have analyzed the reported issue. To resolve the issue, please set the CachingStrategy of ListView to RecycleElement, as shown in the following code snippet,

Code snippet

    <ListView x:Name="listView"

                   ItemsSource="{Binding BookInfo}" CachingStrategy="RecycleElement"

                   RowHeight="100">

        <ListView.ItemTemplate>

            <DataTemplate>

                <ViewCell>

                <Grid Padding="10">

                        <rating:SfRating x:Name="rating" Precision="Standard" />

                    </Grid>

                </ViewCell>

            </DataTemplate>

            </ListView.ItemTemplate>

    </ListView>



Please have a sample from the attachment.

Please check and let us know if you have any concerns.

Regards,
Suganya Sethuraman.


Attachment: ListViewRating_8fe42535.zip

Marked as answer
Loader.
Up arrow icon