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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

ArgumentOutOfRangeExeption when using SfCircularGauge.Headers

Thread ID:

Created:

Updated:

Platform:

Replies:

148093 Oct 4,2019 07:59 PM UTC Oct 10,2019 05:28 AM UTC Xamarin.Forms 3
loading
Tags: SfCircularGauge
Shakil Mohammed
Asked On October 4, 2019 07:59 PM UTC

Hi,

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:

<ListView.ItemTemplate>
            <DataTemplate>
                <ViewCell IsEnabled="false">
                    <Grid RowSpacing="2" Margin="10" ColumnSpacing="20" Padding="10,10,10,0">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <gauge:SfCircularGauge VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" Grid.RowSpan="4" WidthRequest="80" HeightRequest="80" >
                        <gauge:SfCircularGauge.Headers>
            <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:SfCircularGauge.Headers>
            <gauge:SfCircularGauge.Scales>
                
                  <gauge:Scale SweepAngle="360" ShowTicks="False" ShowRim="False" ShowLabels="False" EndValue="{Binding Total}">
                    
                    <gauge:Scale.Ranges>
                        <gauge:Range Offset="1" StartValue="0" EndValue="{Binding Total}" Color="#27ae60"/>
                        <gauge:Range Offset="1" StartValue="{Binding TotalPrayed}" EndValue="{Binding Total}" Color="#e74c3c"/>
                    </gauge:Scale.Ranges>
                    
                   </gauge:Scale>
                
                  </gauge:SfCircularGauge.Scales>

              </gauge:SfCircularGauge>
                        <Label Grid.RowSpan="3" Grid.Column="1" Margin="10" FontSize="25" FontAttributes="Bold" Text="{Binding Name}" TextColor="Black" />                 
                    </Grid>
                </ViewCell>
            </DataTemplate>
        </ListView.ItemTemplate>

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


Attachment: Screenshot_20191004_at_20.57.18_be801c8f.zip

Vignesh Ramesh [Syncfusion]
Replied On October 9, 2019 02:43 PM UTC

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. 

[XAML]: 
<ListView ItemsSource="{Binding ItemsSource}" Grid.Row="1"  CachingStrategy="RecycleElement"
              RowHeight="120">
 

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

Regards, 
Vignesh. 


Shakil Mohammed
Replied On October 9, 2019 09:34 PM UTC

Perfect, that has worked, thank you!

Rachel A [Syncfusion]
Replied On October 10, 2019 05:28 AM UTC

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon