Listview GroupHeaderTemplate not showing property from Model

2 posts, 0 answers
  1. Chintan
    Chintan avatar
    1 posts
    Member since:
    Jun 2017

    Posted 23 Aug 2017 Link to this post



    Below are model properties.

    I am trying to group my list base on the CategoryName and trying to show CategoryName and HealthItemName in my custom header

    Problem: I am able to see the CategoryName  in the header but trying but not able to show up HealthItemName  in my header.

    I am using GroupHeaderTemplate to accomplish the above task. Any pointers?


    model class elements {

        String CategoryName
            String CategoryHealthStatusText { get; set; }
            String HealthItemName { get; set; }




    <telerikDataControls:RadListView AutomationId="RiskList" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" ItemsSource="{Binding Model.RiskItems}" SelectionMode="None">
                        <telerikListView:ListViewItemStyle BackgroundColor="Transparent" BorderLocation="Bottom"/>
                                    <StackLayout Padding="0,10" >
                                        <Label AutomationId="LabsResultsDate" Text="{Binding HealthItemName}"></Label>
                        <telerikListView:PropertyGroupDescriptor   PropertyName="CategoryName"/>
                    <telerikDataControls:RadListView.GroupHeaderTemplate >
                                <svg:SvgCachedImage AutomationId="CategorySvg" WidthRequest="44" HeightRequest="44" Source= "resource://InteractiveHealth.Mobile.Member.Images.icons.cross_or6.svg"  />
                                <Label Text="{Binding }" HorizontalOptions="Center"/>
                                <Label Text="{Binding HealthItemName}" HorizontalOptions="Center"/>
                            <!--<Grid BackgroundColor="Red">
                                <Label Text="{Binding }" TextColor="#303030" FontSize="Medium" HorizontalOptions="Center"/>

  2. Stefan Nenchev
    Stefan Nenchev avatar
    665 posts

    Posted 25 Aug 2017 Link to this post

    Hello Chintan,

    This behavior would be expected as when you are grouping by a specific property, only this property's value is the same for the whole group. The BindingContext of the Group is not an actual item from the source collection as the HealthItemName can be different for the different items from the group. Only the CategoryName is for sure the same for all these items.

    Stefan Nenchev
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top