Bug 23448 - Setting HasUnevenRows = true needed for Group to respect height
Summary: Setting HasUnevenRows = true needed for Group to respect height
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.2.3
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-09-29 07:57 UTC by tim.ahrentlov
Modified: 2016-03-18 08:10 UTC (History)
6 users (show)

Tags:
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:
Status:
RESOLVED FIXED

Description tim.ahrentlov 2014-09-29 07:57:38 UTC
In order for 

    public class TimeGroupCell : ViewCell
    {
        public TimeGroupCell()
        {
            this.Height = 25;
            ...
            ..
            .

to be respected one needs to set HasUnevenRows like in: 

var timeListView = new ListView () 
{
    RowHeight = 80,
    ItemsSource = groupedItems,
    ItemTemplate = new DataTemplate(typeof(TimeEntryCell)),
    IsGroupingEnabled = true,
    GroupHeaderTemplate = new DataTemplate(typeof(TimeGroupCell)),
    HasUnevenRows = true				
};

It seems illogical that HasUnevenRows should influence GroupView behaviour in this way.

It happens on iOS and Android. Windows Phone not tested.

http://forums.xamarin.com/discussion/19573/listview-group-header-issue
Comment 1 Parmendra Kumar 2014-10-01 07:06:02 UTC
I have checked this issue but I am not able to reproduce this Please check the screencast and Let me know if I missed anything. Could you Please provide us some steps or sample project to produce this.

Screencast: http://www.screencast.com/t/LRVYnge7

Environment Info:
=== Xamarin Studio ===

Version 5.4 (build 240)
Installation UUID: 1a096c6f-0678-402e-89b2-a2c10f7e80e4
Runtime:
	Mono 3.8.0 ((no/db71bc1)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 308000013

=== Apple Developer Tools ===

Xcode 6.0.1 (6528)
Build 6A317

=== Xamarin.Mac ===

Version: 1.10.0.13 (Business Edition)

=== Xamarin.Android ===

Version: 4.16.0 (Business Edition)
Android SDK: /Users/360_macmini/Desktop/android-sdk-macosx
	Supported Android versions:
		2.1    (API level 7)
		2.2    (API level 8)
		2.3    (API level 10)
		3.1    (API level 12)
		3.2    (API level 13)
		4.0    (API level 14)
		4.0.3  (API level 15)
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
Java SDK: /usr
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

=== Xamarin.iOS ===

Version: 8.0.0.63 (Business Edition)
Hash: 58b46df
Branch: 
Build date: 2014-09-18 22:32:07-0400
Comment 2 Jeremy Herbison 2015-03-24 18:20:41 UTC
I can confirm this issue. It's actually in most of the good online guides for setting up group headers (see http://motzcod.es/post/94643411707/enhancing-xamarin-forms-listview-with-grouping)

Basically, the Height value of the viewcell in the below groupheaderTemplate is ignored if you remove HasUnevenRows=True. On iOS, this means the groupheader disappears entirely (which is a second bug, I believe).

        <ListView ItemsSource="{Binding Encounters}" ItemTappedCommand="{Binding EditEncounterCommand}" IsGroupingEnabled="True" GroupShortNameBinding="{Binding Key, StringFormat='{0:M/d}'}" HasUnevenRows="True">
          <ListView.GroupHeaderTemplate>
            <DataTemplate>
              <ViewCell Height="40">
                <StackLayout BackgroundColor="Accent" Padding="10">
                  <Label Text="{Binding Key}" TextColor="White" />
                </StackLayout>
              </ViewCell>
            </DataTemplate>
          </ListView.GroupHeaderTemplate>
          <ListView.ItemTemplate>
            <DataTemplate>
              <ViewCell>
                <Grid Padding="10">
                  <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                  </Grid.RowDefinitions>
                  <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="90" />
                    <ColumnDefinition Width="Auto" />
                  </Grid.ColumnDefinitions>
                  <Label Text="{Binding Time}" Grid.Row="0" Grid.Column="0" />
                  <Label Text="{Binding DisplayName}" LineBreakMode="NoWrap" Grid.Row="0" Grid.Column="1" />
                  <Label Text="{Binding IsComplete}" Grid.Row="1" Grid.Column="1" FontSize="Micro" />
                </Grid>
              </ViewCell>
            </DataTemplate>
          </ListView.ItemTemplate>
        </ListView>
Comment 3 Jeremy Herbison 2015-03-24 18:33:44 UTC
I added bug 28391 for the separate iOS-specific issue I mentioned above.
Comment 4 Jason Smith [MSFT] 2016-03-18 08:10:56 UTC
Thank you for taking the time to submit this report. After reviewing the description of this bug, we no longer believe it affects the current version of Xamarin.Forms. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.
 
For your convenience, we have created some reproduction best practices viewable here: https://gist.github.com/jassmith/92405c300e54a01dcc6d

Warm regards,
Xamarin Forms Team