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

Listview Item Apperance Question

Thread ID:





143602 Mar 28,2019 02:11 PM UTC Mar 29,2019 12:03 PM UTC Xamarin.Forms 1
Tags: SfListView
Asked On March 28, 2019 02:11 PM UTC


     I am using SFListView on xamarin forms my question how can i access one item in viewcell on listview codebehind i am sharing my listview below
i want access  x:Name="bjk"  stacklayout when data is filling and change color i couldnt success if anyone help me i will appricate

thank you

<listview:SfListView x:Name="listView" ItemSize="150" SelectionBackgroundColor="White" 
                                         RowSpacing="15" SelectionChanged="ListView_SelectionChanged" ItemAppearing="ListView_ItemAppearing">
                                                <border:SfBorder BorderColor="Black" BorderWidth="0"  CornerRadius="10,0,10,0" Margin="10,10,10,0" BackgroundColor="White" Padding="3">
                                                                <RowDefinition Height="75"/>
                                                                <ColumnDefinition Width="*"/>
                                                                <ColumnDefinition Width="100"/>
                                                            <StackLayout Grid.Column="0" BackgroundColor="White" Orientation="Horizontal">
                                                                <StackLayout Padding="10">
                                                                        <Label Text="{Binding title}" FontAttributes="Bold" FontSize="Large"/>
                                                                        <Label Text="{Binding date}" FontAttributes="Bold"/>
                                                            <StackLayout  Grid.Column="1" Orientation="Horizontal" HorizontalOptions="End" Margin="0,0,30,0">
                                                                <Label Text="&#xf3fd;" FontSize="30" VerticalTextAlignment="Center">
                                                                        <OnPlatform x:TypeArguments="x:String" Android="FontAwesome5Free-Solid-900.otf#Font Awesome 5 Free Solid" iOS="Font Awesome 5 Free"/>
                                                                <Label Text="{Binding sensors.Speed}" FontAttributes="Bold" FontSize="Medium" TextColor="Black" FontFamily="{StaticResource BoldFont}" HorizontalTextAlignment="Center" VerticalTextAlignment="Center"/>
                                                        <StackLayout Orientation="Horizontal">
                                                            <Label Text="Günlük Mesafe : " FontAttributes="Bold"/>
                                                            <Label Text="{Binding sensors.TodaysDistance}"/>
                                                            <Label Text="Toplam Mesafe : " FontAttributes="Bold"/>
                                                            <Label Text="{Binding sensors.TotalDistance}"/>
                                                        <StackLayout x:Name="bjk" Orientation="Horizontal" BackgroundColor="Green">
                                                            <Label x:Name="lbDurum"  Text="Kontak Açık" TextColor="White"/>
                                                            <Label x:Name="lbAdres"  Text="{Binding address}" TextColor="White"/>


Deivaselvan Y [Syncfusion]
Replied On March 29, 2019 12:03 PM UTC

Hi Burak, 

Thanks for using  Syncfusion products. 

We have checked the reported query from our side. We would like to inform you that you cann’t access the element inside the ItemTemplate directly from code behind. In order to achieve your requirement, you can bind the model property to BackgroundColor of StackLayout property and change it accordingly when the items fills as per your requirement. We have attached the sample based on your requirement for your reference, please find the sample from below. 

Please let us know if you need any further assistance. 



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