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

SfListView inside SfTabView?

Thread ID:

Created:

Updated:

Platform:

Replies:

147465 Sep 11,2019 02:21 PM UTC Sep 13,2019 07:09 AM UTC Xamarin.Forms 3
loading
Tags: SfListView
msd
Asked On September 11, 2019 02:21 PM UTC

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




Gnana Priya Namasivayam [Syncfusion]
Replied On 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 


msd
Replied On 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

Sangeetha Raju [Syncfusion]
Replied On 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. 


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