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

ArgumentOutOfRangeExeption when using SfCircularGauge.Headers


I'm using the SfCircularGauge control, within a ListView. The source of the ListView is using a Binded property. Everything works fine, however when the Binding Model is updated and the PropertyUpdated event fires, I get an ArgumentOutOfRangeException (stack trace attached).

This is the code I am using:

                <ViewCell IsEnabled="false">
                    <Grid RowSpacing="2" Margin="10" ColumnSpacing="20" Padding="10,10,10,0">
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition />
                        <gauge:SfCircularGauge VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" Grid.RowSpan="4" WidthRequest="80" HeightRequest="80" >
            <gauge:Header Text="{Binding TotalRemaining}" Position="0.5, 0.45" ForegroundColor="#0682F6" FontAttributes="Bold" TextSize="13"/>
            <gauge:Header Text="REMAINING" Position="0.5, 0.625" ForegroundColor="#0682F6" FontAttributes="Bold" TextSize="6"/>   
                  <gauge:Scale SweepAngle="360" ShowTicks="False" ShowRim="False" ShowLabels="False" EndValue="{Binding Total}">
                        <gauge:Range Offset="1" StartValue="0" EndValue="{Binding Total}" Color="#27ae60"/>
                        <gauge:Range Offset="1" StartValue="{Binding TotalPrayed}" EndValue="{Binding Total}" Color="#e74c3c"/>

                        <Label Grid.RowSpan="3" Grid.Column="1" Margin="10" FontSize="25" FontAttributes="Bold" Text="{Binding Name}" TextColor="Black" />                 

Please can you assist - Is it a bug or am I implementing it incorrectly?

Attachment: Screenshot_20191004_at_20.57.18_be801c8f.zip

3 Replies

VR Vignesh Ramesh Syncfusion Team October 9, 2019 09:43 AM

Hi Shakil, 

Greetings from Syncfusion. 

We have analyzed the reported problem in our end and would like to inform that, it is due to old Element’s object are not disposed properly in ListView. You can overcome this problem by setting CachingStrategy as RecycleElement as like below snippet. 

<ListView ItemsSource="{Binding ItemsSource}" Grid.Row="1"  CachingStrategy="RecycleElement"

Please find the sample for the same from the below link. 


SM Shakil Mohammed October 9, 2019 04:34 PM

Perfect, that has worked, thank you!

RA Rachel A Syncfusion Team October 10, 2019 12:28 AM

Hi Shakil, 
Thanks for the confirmation. 
Please let us know if you have any other queries. 

Live Chat Icon For mobile
Up arrow icon