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

GroupHeader rendering

Hey,

I ran in the Problem that everytime I'm using the SfListView-Header the first HeaderGroup is indented as seen in the screenshot. What I see is that the missing part of the first HeaderGroup is exactly the same size as the scrollbar.

this is my Code

_tripsListView.GroupHeaderTemplate = new DataTemplate(() =>
      {
        var grid = new Grid()
        {
          BackgroundColor = Color.FromHex(hexBackgroundColor)
        };
        grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
        grid.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
        var grouping = new StackLayout()
        {
          VerticalOptions = LayoutOptions.Center,
          HorizontalOptions = LayoutOptions.Start,
          Orientation = StackOrientation.Horizontal,
          Padding = new Thickness(0, 0, 0, 0)
        };
        var yearLabel = new Label
        {
          TextColor = Color.FromHex(hexFontColor),
          FontSize = fontSize + 6,
          FontAttributes = FontAttributes.Bold
        };
    var groupingImg = new Image() {
        Source = ImageSource.FromResource("BaseKit.Resources.arrow_down_white.png"),
    };
    groupingImg.SetBinding(Image.SourceProperty, "IsExpand", BindingMode.Default, new GroupingConverter(), null);
        yearLabel.SetBinding(Label.TextProperty, new Binding("Key"));
    grouping.Children.Add(groupingImg);
        grouping.Children.Add(yearLabel);

        var counting = new StackLayout()
        {
          VerticalOptions = LayoutOptions.Center,
          HorizontalOptions = LayoutOptions.EndAndExpand,
          Orientation = StackOrientation.Horizontal
        };
        var countLabel = new Label
        {
          TextColor = Color.FromHex(hexFontColor),
          FontSize = fontSize + 6
        };
        countLabel.SetBinding(Label.TextProperty, new Binding("Count", BindingMode.Default, null, null, "{0,3:###}"));
        var countlabel2 = new Label() { Text = "Trips:", TextColor = Color.FromHex(hexFontColor), FontSize = fontSize + 6 };
        counting.Children.Add(countlabel2);
        counting.Children.Add(countLabel);
        grid.Children.Add(grouping);
        grid.Children.Add(counting, 1, 0);
        return grid;
      });

Attachment: Screenshot_20181127101709_8f30b482.zip

1 Reply

JN Jayaleshwari N Syncfusion Team November 28, 2018 12:07 PM UTC

Hi Thomas,  
  
Thanks for using Syncfusion products.  
  
We have checked the reported query “First group header not renderer properly” from our end. We have prepared the sample based on the template given by you. Unfortunately, the reported issue does not replicate at our end. Listview is loaded in the view as expected and group header rendered properly.  
  
For your reference we have attached the sample and you can download it from the below link.  
  
  
Can you please check the reported issue occurs in our sample also? If the sample does not meet you requirement then we request to modify the sample to replicate the issue or Please share the more details about the reported issue which would highly help us to analyze the query better and provide an appropriate solution.    
  
Regards,  
Jayaleshwari N 


Loader.
Up arrow icon