- Home
- Forum
- Xamarin.Forms
- Add sfrating to a cell
Add sfrating to a cell
Hi all,
I have the following xaml
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:controls="clr-namespace:XLabs.Forms.Controls;assembly=XLabs.Forms"
xmlns:rating="clr-namespace:Syncfusion.SfRating.XForms;assembly=Syncfusion.SfRating.XForms"
x:Class="WSTest2.ValorarServicio">
<ScrollView>
<StackLayout Spacing="5" Padding="10" VerticalOptions="FillAndExpand">
<Grid x:Name="gridEncuesta" VerticalOptions="StartAndExpand" HorizontalOptions="StartAndExpand" ColumnSpacing="5" RowSpacing="15" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="3*" />
<ColumnDefinition Width="2*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="100" />
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" x:Name="lblDescripcionEncuesta" Font="Bold,15" VerticalOptions="CenterAndExpand" />
</Grid>
</StackLayout>
</ScrollView>
</ContentPage>
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)
{
ActualRow++;
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);
}
UserDialogs.Instance.HideLoading();
}
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.
SIGN IN To post a reply.
1 Reply
CP
Chozarajan Pandiyarajan
Syncfusion Team
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
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.
Regards,
Chozarajan P.
SIGN IN To post a reply.
- 1 Reply
- 2 Participants
-
AP Arturo Pérez García
- Sep 16, 2016 11:59 AM UTC
- Sep 20, 2016 01:10 PM UTC