[ ] Regression (a behavior that used to work and stopped working in a new release)
[X ] Bug report <!-- Please search GitHub for a similar issue or PR before submitting -->
[ ] Feature request <!-- Please file a UserVoice request and include the link below https://wpdev.uservoice.com/forums/110705-universal-windows-platform/category/193402-uwp-community-toolkit -->
[ ] Sample app request
[ ] Documentation issue or request
[ ] Question of Support request => Please do not submit support request here, instead see https://github.com/Microsoft/UWPCommunityToolkit/blob/master/contributing.md#question
After updating from Microsoft.Toolkit.Uwp.UI.Controls 2.0.0 to 2.1.0 or 2.1.1 the HorizontalAlignment="Center" property on the AdaptiveGridView causes the application to crash.
Error "Layout Cycle Detected"
Expected behaviour is that the adaptive grid view centers horizontally as in previous versions.
<controls:AdaptiveGridView Name="AdaptiveGridViewControl"
OneRowModeEnabled="@[OneRowModeEnabled:Bool:false]"
ItemHeight="@[ItemHeight:Slider:200:50-500]"
DesiredWidth="@[DesiredWidth:Slider:300:50-500]"
SelectionMode="@[SelectionMode:Enum:ListViewSelectionMode.Single]"
IsItemClickEnabled="@[IsItemClickEnabled:Bool:true]"
ItemTemplate="{StaticResource PhotosTemplate}"
HorizontalAlignment="Center" />
Nuget Package(s):
Package Version(s):
Windows 10 Build Number:
- [ ] Anniversary Update (14393)
- [ ] Creators Update (15063)
- [ X] Fall Creators Update (16299)
- [ ] Insider Build (xxxxx)
App min and target version:
- [ ] Anniversary Update (14393)
- [ ] Creators Update (15063)
- [X ] Fall Creators Update (16299)
- [ ] Insider Build (xxxxx)
Device form factor:
- [X ] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT
Visual Studio
- [ ] 2017 15.3
- [ ] 2017 15.4
- [ X] 2017 15.5.2
I am having the exact same issue, and wanted to set it to center, because it was leaving a lot of space on the right, which it shouldnt, considering it should adapt and fill the space on the right
ping @skendrot
I can verify this is a bug
@nmetulev I also opened an issue on same problem, I think one of these should be closed for ease? you guyx can decide on which one to track :)
@nmetulev Any reason this was changed? That's what is causing the crash.
@touseefbsb Your issue with using ItemContainerStyle is different than this issue
@skendrot Oh ok thanks for claifying
@Martijn85 Why would you want to set HorizontalAlignment to Center? that defeats the purpose of using the AdaptiveGridView because now the elements maintain the size. I would recommend using a regular GridView in this case
Note: Not saying this issue shouldn't be fixed
@nmetulev Any reason this was changed? That's what is causing the crash.
I changed this in #1552, items were overflowing due to fractions in layout calculation rounding down. I'm sure there is another way to accomplish the same.
@skendrot You are correct of course. The default GridView does work as a solution now. Some of the design choices changed over time and instead of replacing adaptive grid control I just added the horizontal alignment everywhere. It is not a big issue, just noticed that after version 2.0.0 the program was suddenly crashing when opening a view with this code in it.
This issue seems inactive. Do you need help to complete this issue?
Issue is solved by replacing AdaptiveGridView with the default GridView.
For the future perhaps this issue could also be solved in the AdaptiveGridView, but it has no priority.
Thanks all for your help.
@Martijn85 I think it will be solved in AdaptiveGridView as well as the team is working on it so I guess u should keep the issue opened :)
Yes, there is a work around, but the control shouldn't crash the application. We'll get it fixed.
Most helpful comment
@Martijn85 Why would you want to set HorizontalAlignment to Center? that defeats the purpose of using the AdaptiveGridView because now the elements maintain the size. I would recommend using a regular GridView in this case
Note: Not saying this issue shouldn't be fixed