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
close icon

SfListView Binding to ObservableCollection<T>

Hi,
I've some problem with binding SfListView to ObservableCollection<T>: when collection contains more then one element they are showed corretly into Xaml page, instead when the collection contains only one element this is not show.

XAML:
    <ContentPage.Content>
        <StackLayout>
            <!-- Frame cover with gallery and commands-->
            <Frame HasShadow="True" BackgroundColor="White" Padding="0" >
                <StackLayout VerticalOptions="Start" Padding="0"  Spacing="0">

                    <!-- Cover -->
                    <Grid BackgroundColor="White" HeightRequest="120">
                        <Image Source="cover.png" Opacity="0.5" Aspect="AspectFill" />

                        <sflistview:SfListView Orientation="Horizontal" ItemSpacing="0" ItemSize="120"
                                                        ItemsSource="{Binding Pictures}" >
                            <sflistview:SfListView.Behaviors>
                                <behaviors:EventToCommandBehavior
                                                    EventName="ItemTapped"
                                                    Command="{Binding ViewAlbumCommand}" />
                            </sflistview:SfListView.Behaviors>
                            <sflistview:SfListView.ItemTemplate>
                                <DataTemplate>
                                    <ffimage:CachedImage Aspect="AspectFill" Source="{Binding ThumbUri}" />
                                </DataTemplate>
                            </sflistview:SfListView.ItemTemplate>
                        </sflistview:SfListView>
                    </Grid>
                   
                    <!-- other grid -->
                </StackLayout>
            </Frame>

          <!-- other frame -->
        </StackLayout>
    </ContentPage.Content>

Why?
Thnks,
Valeriano Simeone


1 Reply

MK Muthu Kumaran Gnanavinayagam Syncfusion Team June 8, 2017 10:10 AM UTC

Hi Valeriano, 
 
Sorry for the inconvenience. 
 
We are able to reproduce the reported issue “SfListView in Horizontal orientation does not layout when Binding only one item from ObservableCollection” at our end. As this is forum, we cannot provide patch. Therefore a new support incident has been created under your account for providing custom assemblies which includes the fix for the reported issue. Please log on to our support website to check for further updates.            
      
 
Regards, 
G.Muthu Kumaran. 


Loader.
Live Chat Icon For mobile
Up arrow icon