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 inside SfTabView?

im having problems with SfListView inside SfTabView on android

it works fine on UWP

the problem occurs only when binding data to the listview

it loads fine on the page

but when binding data Im getting "cannot convert "header" into system.double"

public ObservableCollection<FavoritesList> BkmList { get; set; }
        public BookmarksVM()
        {
            try
            {
                BkmList = new ObservableCollection<FavoritesList>(bookmarksDb.FavoritesList.ToList());
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }

        <tabView:SfTabView EnableSwiping="False">
            <tabView:SfTabItem Title="المفضلة"> <!--ImageSource="staricon.png"-->
                <tabView:SfTabItem.Content>
                    <AbsoluteLayout>
                        <StackLayout VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" AbsoluteLayout.LayoutBounds="0,0,1,1" AbsoluteLayout.LayoutFlags="All">
                            <xForms:SfListView x:Name="BookmarksListView" AllowSwiping="True" ItemsSource="{Binding BkmList, Mode=TwoWay}">
                                <xForms:SfListView.BindingContext>
                                    <local:BookmarksVM />
                                </xForms:SfListView.BindingContext>
                                <xForms:SfListView.RightSwipeTemplate>
                                    <DataTemplate x:Name="RightSwipeTemplate">
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="*" />
                                                <ColumnDefinition Width="*" />
                                            </Grid.ColumnDefinitions>
                                            <Grid BackgroundColor="#009EDA" HorizontalOptions="Fill" VerticalOptions="Fill" Grid.Column="0">
                                                <Grid VerticalOptions="Center" HorizontalOptions="Center">
                                                    <Image Grid.Column="0" Grid.Row="0" BackgroundColor="Transparent" HeightRequest="35" WidthRequest="35" Source="editicon.png" ClassId="{Binding ListName}">
                                                        <Image.GestureRecognizers>
                                                            <TapGestureRecognizer/>
                                                        </Image.GestureRecognizers>
                                                    </Image>
                                                </Grid>
                                            </Grid>
                                            <Grid BackgroundColor="#DC595F" HorizontalOptions="Fill" VerticalOptions="Fill" Grid.Column="1">
                                                <Grid VerticalOptions="Center" HorizontalOptions="Center">
                                                    <Image Grid.Column="0" Grid.Row="0" HeightRequest="35" WidthRequest="35" BackgroundColor="Transparent" Source="deleteicon.png" ClassId="{Binding ListName}" >
                                                        <Image.GestureRecognizers>
                                                            <TapGestureRecognizer/>
                                                        </Image.GestureRecognizers>
                                                    </Image>
                                                </Grid>
                                            </Grid>
                                        </Grid>
                                    </DataTemplate>
                                </xForms:SfListView.RightSwipeTemplate>
                                <xForms:SfListView.ItemTemplate>
                                    <DataTemplate>
                                        <Grid>
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition Width="1*"/>
                                            </Grid.ColumnDefinitions>
                                            <Label Grid.Column="0" Text="{Binding ListName}" FontSize="Header" VerticalTextAlignment="Center"></Label>
                                        </Grid>
                                    </DataTemplate>
                                </xForms:SfListView.ItemTemplate>
                            </xForms:SfListView>
                        </StackLayout>
                        <ImageButton AbsoluteLayout.LayoutBounds=".9, .9, AutoSize, AutoSize" AbsoluteLayout.LayoutFlags="PositionProportional" Source="actionbutton.png" WidthRequest="50" HeightRequest="50" BackgroundColor="Transparent"></ImageButton>
                    </AbsoluteLayout>
                </tabView:SfTabItem.Content>
            </tabView:SfTabItem>
        </tabView:SfTabView>



Xamarin forms 3.6.0.709228
SfListView 17.1.0.53
android target 9.0

thanks




3 Replies

GP Gnana Priya Namasivayam Syncfusion Team September 12, 2019 10:36 AM UTC

Hi Msd, 
 
We have checked the reported query based on your template from our side. We have attached the sample for your reference. Please find the sample from below. 
   
 
Can you please check with the above sample whether you get same error in our sample also. If not, please compare and check your application else revert us back with the issue reported sample. So that we could able to analyze your application in detail to provide the appropriate solution at our end. 
 
Regards, 
Gnana Priya N 



MS msd September 12, 2019 01:50 PM UTC

it works now

set compile using android version to 9.0 
and
updating Xamarin froms to latest version solved the problem

thanks


SR Sangeetha Raju Syncfusion Team September 13, 2019 07:09 AM UTC

Hi msd, 
 
Thanks for the update.  
Please let us know if you require any further assistance. 
 
Regards, 
Sangeetha Raju. 


Loader.
Live Chat Icon For mobile
Up arrow icon