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

Listview Item Apperance Question


     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"/>


1 Reply

DY Deivaselvan Y Syncfusion Team 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. 


Live Chat Icon For mobile
Up arrow icon