Bug 28883 - Setting GroupDisplayBinding after GroupHeaderTemplate removes custom header template
Summary: Setting GroupDisplayBinding after GroupHeaderTemplate removes custom header t...
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.4.1
Hardware: PC Windows
: --- enhancement
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-04-08 08:44 UTC by Mitch Milam
Modified: 2016-04-08 19:37 UTC (History)
4 users (show)

Tags: docs
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Mitch Milam 2015-04-08 08:44:28 UTC
The documentation clearly states the following:

GroupHeaderTemplate is mutually exclusive with ListView.GroupDisplayBinding. Setting this property will set ListView.GroupDisplayBinding to null. 

And if you have the following code:

list.GroupDisplayBinding = new Binding("Key");
list.GroupHeaderTemplate = new DataTemplate(typeof (HeaderCell));

It works exactly as you specified.

The issue is if you have set these properties in this order:

list.GroupHeaderTemplate = new DataTemplate(typeof (HeaderCell));
list.GroupDisplayBinding = new Binding("Key");

Setting the GroupDisplayBinding after the GroupHeaderTemplate is defined will remove the custom header template.

This effects both iOS and Android. 

This can be a very simple mistake to make. So I think either:

1. The documentation needs to be updated and the above information added.
2. When the GroupDisplayBinding is set, if the GroupHeaderTemplate is not null, then the set GroupDisplayBinding  operation is ignored.

** Sample code and screen shots attached.
Comment 1 Mitch Milam 2015-04-08 08:58:19 UTC
Actually, the documentation does indeed state the obvious:

This property is mutually exclusive with ListView.GroupHeaderTemplate property. Setting it will set ListView.GroupHeaderTemplate to null. 

But it would be really helpful to have those statements combined onto a single page.