Bug 21839 - Grid not sizing to contents
Summary: Grid not sizing to contents
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.2.2
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Jason Smith [MSFT]
Depends on:
Reported: 2014-08-05 14:12 UTC by Jon Goldberger [MSFT]
Modified: 2015-02-05 12:46 UTC (History)
7 users (show)

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

Test Project (5.89 MB, application/zip)
2014-08-05 14:12 UTC, Jon Goldberger [MSFT]

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 Jon Goldberger [MSFT] 2014-08-05 14:12:15 UTC
Created attachment 7591 [details]
Test Project

I am trying to develop an application that uses a Xamarin.Form Grid to evenly display 3 columns of information across a tablet's screen. On iOS, the data in the grid breaks the bounds of the Grid so that it covers the information that comes after the Grid in the layout of the page. This technically happens on Android as well, but not to a degree that it is visible to the user. Is there some way that I can have the Grid control resize to contain the controls inside of it?

Here is a sample reproduction of the problem: https://dl.dropboxusercontent.com/u/14533268/GridBug/Krannert.Smef.zip [Attached]

After the app loads, clicking on the image displayed will bring up the screen that shows the problem. The grid has a green background to show the limit of the grid. You can see in Android that the content of the grid doesn't extend past the bounds of the grid to a degree that it interferes with the next item in the layout. However, that is not true on the iOS project.
Comment 2 Jon Goldberger [MSFT] 2014-08-05 14:14:56 UTC
I confirmed this issue running the test project. I tried setting RowDefinitions with 
Height = GridLength.Auto
Height = new GridLength(1, GridUnitType.Star)
with no noticeable change.
Comment 3 Sadik Ali 2014-08-20 05:57:49 UTC
I have checked this issue with attached Test Project and able to reproduce this issue. I observed that grid does not get resize to contain the controls inside it. I  have also checked this with syntax given in Comment 2. Also tried it with giving the fixed height like height= 20,50,100 or 200. But not able to see any changes.

Screencast : http://screencast.com/t/xbUrUybvZUS

Environment Info :

Xamarin.Forms :

=== Xamarin Studio ===

Version 5.2.1 (build 1)
Installation UUID: 67eaf3b4-f8a7-4ab4-a9df-3197350ca5dc
	Mono 3.6.0 ((no/f540f8a)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 306000039

=== Apple Developer Tools ===

Xcode 5.1.1 (5085)
Build 5B1008

=== Xamarin.Android ===

Version: 4.14.0 (Business Edition)
Android SDK: /Users/ixamarin78/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)
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: (Business Edition)
Hash: 606f31a
Build date: 2014-08-01 15:27:48-0400

=== Xamarin.Mac ===

Version: (Business Edition)

=== Build Information ===

Release ID: 502010001
Git revision: d06832ce9807d6be24aca225457e8b37c7669f6f
Build date: 2014-08-07 12:10:47-04
Xamarin addins: 1de032531be4cecf2f39dbee3b87aac78204058c

=== Operating System ===

Mac OS X 10.9.4
Darwin XamnewiMac.local 13.3.0 Darwin Kernel Version 13.3.0
    Tue Jun  3 21:27:35 PDT 2014
    root:xnu-2422.110.17~1/RELEASE_X86_64 x86_64
Comment 4 Rui Marinho 2015-02-05 12:46:10 UTC
this is fixed in 1.3.2