Bug 26593 - [WinPhone] ListView ignores HasUnevenRows value, always behaves as if set to true
Summary: [WinPhone] ListView ignores HasUnevenRows value, always behaves as if set to ...
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.3.1
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-01-30 07:25 UTC by bjornr.sioux
Modified: 2015-05-26 14:13 UTC (History)
4 users (show)

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


Attachments
Screenshot to illustrate a data templates example (11.51 KB, image/png)
2015-01-30 07:25 UTC, bjornr.sioux
Details


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 bjornr.sioux 2015-01-30 07:25:24 UTC
Created attachment 9578 [details]
Screenshot to illustrate a data templates example

On Windows Phone, the value of the ListView's HasUnevenRows property is not respected. The ListView always allows having "uneven" rows, even if this property is set to false.

Tested on:
- Xamarin.Forms 1.2.3 (stable) and 1.3.1 (stable)
- Windows Phone 8.1

Steps to reproduce this issue:

I used sample code, as suggested by Mark Smith on the Xamarin forums, to achieve my desired use case, where two data templates are used in conjunction with the ListView control. Please refer to http://forums.xamarin.com/discussion/comment/57207/#Comment_57207 for more info. However, I would assume any setup that effectively generates two different data templates triggers the issue.

Refering to this sample code; replace the code in the OnSelectTemplate method with something that generates two data templates that each result in a row with some arbitrary (but different) rendered size, i.e.:

if (dataOb is Employee)
            {
                return new DataTemplate(() =>
                {
                    var label = new Label();
                    label.Text = "Some text";
                    return new ViewCell() { View = label };
                });
            }
            else
            {
                return new DataTemplate(() =>
                {
                    var label = new Label();
                    label.Text = "Some text";
                    var labelTwo = new Label();
                    labelTwo.Text = "More text";
                    var labelThree = new Label();
                    labelThree.Text = "Yet some more text";
                    return new ViewCell()
                    {
                        View = new StackLayout
                        {
                            Children =
                            {
                                label, labelTwo, labelThree
                            }
                        }
                    };
                });