Xamarin.Forms: GroupHeaderTemplate is not visible, neither are the items but seems to partially render

pigninja

I have a GroupHeaderTemplate in Xamarin.Forms for a ListView element which is not rendering. You can select the headers, and pull up the quick menu. I can successfully render the groups if I use the property of the ListView element GroupDisplayBinding, yet when I specify GroupHeaderTemplate property of ListView nothing renders. In both cases my ListView ItemTemplate does not render. If I remove the header, the ItemTemplate renders as expected.

<ResourceDictionary>
      <local:DateConverter x:Key="dateConverter" />
    </ResourceDictionary>
  </ContentPage.Resources>   
<ListView x:Name="barGraphListView" ItemsSource="{x:Static local:BarGraphModelColl.bgModelColl}"
              IsGroupingEnabled="True"
              HasUnevenRows="True" HorizontalOptions="FillAndExpand" VerticalOptions="EndAndExpand">
      <ListView.GroupHeaderTemplate>
        <DataTemplate>
          <ViewCell Height="25">
            <Label Text="{Binding Date, Converter={StaticResource dateConverter}}" TextColor="White" />
          </ViewCell>
        </DataTemplate>
      </ListView.GroupHeaderTemplate>
      <ListView.ItemTemplate>
        <DataTemplate>
            <StackLayout Orientation="Vertical" Padding="0,10">
              <Label Text="{Binding DataCategory}" />
              <BoxView WidthRequest="{Binding BarHeight}" HorizontalOptions="Start" Color="Blue" HeightRequest="20" />
            </StackLayout>
        </DataTemplate>
      </ListView.ItemTemplate>
    </ListView>

This is my converter

class DateConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo cultureInfo)
    {
        DateTime dateTime = (DateTime)value;
        return String.Format("{0:dddd, MMMM d, yyyy}", dateTime);
    }

    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo cultureInfo)
    {
        throw new NotImplementedException();
    }
}
JamesMontemagno

You will need to specify your GroupDisplayBinding property on your ListView so it knows what to display and bind to. You will want to probably use my Grouping here and you wouldn't even need to use your converter as it would just be your Key.

http://motzcod.es/post/94643411707/enhancing-xamarin-forms-listview-with-grouping

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Bound commands not getting fired for partially visible items inside a listbox

From Dev

How to render only visible items in AngularJs Dropdown

From Dev

How to render only visible items in AngularJs Dropdown

From Dev

Xamarin Forms - point to label which became visible

From Dev

Render google sign in Button in xamarin forms application

From Dev

Magnification of items during scrolling in Xamarin.Forms

From Dev

Xamarin forms position of toolbar items for android

From Dev

Padding between items in Xamarin.Forms ListView

From Dev

Best way to render only the visible cluster items on a google map

From Dev

Activity Indicator is not visible on xaml page in xamarin.forms?

From Dev

How to get the visible list items count in a Xamarin android Array adapter

From Dev

How to render a xamarin.forms view in a custom renderer

From Dev

Displaying a Xamarin Forms StackList doesn't render properly

From Dev

DialogFragment ~ partially visible dialog buttons

From Dev

Dropdown partially visible in Kivy (Python)

From Dev

Can I reorder the ListView items on the Run in Xamarin.Forms?

From Dev

Xamarin.Forms: Get all cells/items of a listview

From Dev

Xamarin Forms List View Showing Row items in Frames

From Dev

Xamarin Forms - Show Cancel button in toolbar items instead of Back (iOS)

From Dev

Can I reorder the ListView items on the Run in Xamarin.Forms?

From Dev

Xamarin forms: How to access the toggled items id using OnToggledEvent

From Dev

Xamarin.Forms activate/deactivate toolbar items not working

From Dev

Render to Tex only partially writing

From Dev

MongoDB count partially indexed items

From Dev

Xamarin.Forms Switch Control is not Visible on Android prior to selecting an Entry Control

From Dev

How to Center/Set Zoom of Map to cover all markers visible on Xamarin.Forms?

From Dev

Make the next viewcontroller partially visible via UIPageViewController

From Java

Get visible items in RecyclerView

From Dev

Items in GridView not visible

Related Related

  1. 1

    Bound commands not getting fired for partially visible items inside a listbox

  2. 2

    How to render only visible items in AngularJs Dropdown

  3. 3

    How to render only visible items in AngularJs Dropdown

  4. 4

    Xamarin Forms - point to label which became visible

  5. 5

    Render google sign in Button in xamarin forms application

  6. 6

    Magnification of items during scrolling in Xamarin.Forms

  7. 7

    Xamarin forms position of toolbar items for android

  8. 8

    Padding between items in Xamarin.Forms ListView

  9. 9

    Best way to render only the visible cluster items on a google map

  10. 10

    Activity Indicator is not visible on xaml page in xamarin.forms?

  11. 11

    How to get the visible list items count in a Xamarin android Array adapter

  12. 12

    How to render a xamarin.forms view in a custom renderer

  13. 13

    Displaying a Xamarin Forms StackList doesn't render properly

  14. 14

    DialogFragment ~ partially visible dialog buttons

  15. 15

    Dropdown partially visible in Kivy (Python)

  16. 16

    Can I reorder the ListView items on the Run in Xamarin.Forms?

  17. 17

    Xamarin.Forms: Get all cells/items of a listview

  18. 18

    Xamarin Forms List View Showing Row items in Frames

  19. 19

    Xamarin Forms - Show Cancel button in toolbar items instead of Back (iOS)

  20. 20

    Can I reorder the ListView items on the Run in Xamarin.Forms?

  21. 21

    Xamarin forms: How to access the toggled items id using OnToggledEvent

  22. 22

    Xamarin.Forms activate/deactivate toolbar items not working

  23. 23

    Render to Tex only partially writing

  24. 24

    MongoDB count partially indexed items

  25. 25

    Xamarin.Forms Switch Control is not Visible on Android prior to selecting an Entry Control

  26. 26

    How to Center/Set Zoom of Map to cover all markers visible on Xamarin.Forms?

  27. 27

    Make the next viewcontroller partially visible via UIPageViewController

  28. 28

    Get visible items in RecyclerView

  29. 29

    Items in GridView not visible

HotTag

Archive