FlowListView group header template


I've just tried the FlowListView control @DanielL made, which works perfectly for my needs. I just have a small issue, that I might be missing on something to make it work...

I simply want to adjust the group header template. I mostly followed the example found on the GitHub repo, and then added a property set on the GroupHeaderTemplate, which I thought would work since the control is based on the ListView, but it doesn't seem to be taking my changes (I added a red background to see the change and it doesn't show up).

Has someone tried doing a group header template that could point me towards the right direction ?



  • DanielLDanielL PLInsider ✭✭✭✭

    @BrunoBarrette Yes, the control is a ListView derivative, so headers work just the same as in standard ListView. Did you try if your custom header works on a standard ListView?

  • It's actually the first time I'm using a ListView (or derivative) that requires a grouping, so I hadn't tried no.

    I've just tried, read a bit, and eventually realized that GroupHeaderTemplate and GroupDisplayBinding don't go together, so it was all a noobs issue in the end...

    I now have my template, but the header binding doesn't seem to apply. I'm going for lunch now, but right after I'll be adapting my collection to be a grouped collection instead of the list of items it currently is using.

    Thanks for the quick reply, it helped me look in the right way!

  • So, in the end, here's what I had to do...

    I removed the GroupDisplayBinding call and added a DataTemplate to the GroupHeaderTemplate property.

    As for the template itself, the only thing I had to explicitly specify was for its binding to be "Key", since it's the name of the property inside your FlowGroup class. At first I was trying with the property name of my object (not using the FlowItem), so that wasn't working, but setting it this way everything works fine!

    Thanks again, great component by the way!

  • DanielLDanielL PLInsider ✭✭✭✭

    Thanks. I'm glad that you worked it out! :)

  • praveenaHMpraveenaHM USMember ✭✭
    edited January 2017

    Hi everyone,
    I am new in xamarin forms. I am working on FlowListView in xamarin forms. But flowlistview not showing in screen. what is the problem.

  • SalahAtmitimSalahAtmitim USMember
    edited January 2017

    Hello @BrunoBarrette
    I am facing the same problem as you : The groupHeader is not appearing when i use a GroupHeaderTemplate because the binding its text content is not working. Could you please share the solution with more details ?
    It will help me a lot :)
    Thank you

  • DanielLDanielL PLInsider ✭✭✭✭

    @praveenaHM If you use it XAML-only, linker cuts it. Put FlowListView.Init() somewhere in your code.

    @SalahAtmitim Full example of grouping is here: https://github.com/daniel-luberda/DLToolkit.Forms.Controls/blob/master/Samples/DLToolkitControlsSamples/SamplesFlowListView/GroupingPage.xaml

  • SalahAtmitimSalahAtmitim USMember

    @DanielL Thank you Daniel. Great work :)

Sign In or Register to comment.