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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Add sfrating to a cell

Thread ID:





125997 Sep 16,2016 11:59 AM UTC Sep 20,2016 01:10 PM UTC Xamarin.Forms 1
Tags: SfRating
Arturo Pérez García
Asked On September 16, 2016 11:59 AM UTC

Hi all,

I have the following xaml
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
    <StackLayout Spacing="5" Padding="10" VerticalOptions="FillAndExpand">
      <Grid  x:Name="gridEncuesta" VerticalOptions="StartAndExpand" HorizontalOptions="StartAndExpand" ColumnSpacing="5" RowSpacing="15" >
          <ColumnDefinition Width="3*" />
          <ColumnDefinition Width="2*" />
          <RowDefinition Height="100" />
        <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" x:Name="lblDescripcionEncuesta" Font="Bold,15" VerticalOptions="CenterAndExpand" />

And in my code behind I Dynamically charge sfratings follows 
        protected override async void OnAppearing()
            UserDialogs.Instance.ShowLoading("Recuperando la encuesta de la Solicitud [" + this.aviso.NUMERO + "].", MaskType.Black);
            string Encuesta_List = await GetEncuestaRealizada(this.aviso.ID_ENCUESTA_REALIZADA);
            lblDescripcionEncuesta.Text = encuestacabecera.TEXTO;
            int ActualRow = 0;
            foreach (Encuesta_Realizada_Detalle encuestarealizadadetalle in encuestarealizadadetallelist)
                gridEncuesta.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
                gridEncuesta.Children.Add(new Label
                    Text = "XXX-" + ActualRow,
                    HorizontalOptions = LayoutOptions.StartAndExpand,
                    VerticalOptions = LayoutOptions.Center,
                    FontAttributes = FontAttributes.Bold
                }, 0, ActualRow);

                gridEncuesta.Children.Add(new SfRating
                    Value = encuestarealizadadetalle.VALOR,
                    ItemCount = 5,
                    ItemSpacing = 7,
                    ItemSize = 25,
                    ReadOnly = true,
                    HorizontalOptions = LayoutOptions.EndAndExpand,
                    VerticalOptions = LayoutOptions.CenterAndExpand,
                }, 1, ActualRow);
The only result I load a row, when the list I have 4 elements.
If I run the same process without loading the sfrating control works properly.
Someone could help me.
Thank you.

Sorry for my English is very bad.

Chozarajan Pandiyarajan [Syncfusion]
Replied On September 20, 2016 01:10 PM UTC

Hi Arturo,

Thank you for contacting Syncfusion support.

We were unable to reproduce the reported problem at our end. And we have achieved your requirement by modifying your codes please download the same from the following link.

Link: http://www.syncfusion.com/downloads/support/forum/125997/ze/RatingTest463671671 

If your requirement is different from the above please modify the sample and update us with more details. That will help us to assist you further.

Chozarajan P. 


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

or the page will be automatically redirected to 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