Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AdaptiveGridView HorizontalAlignment not working after version 2.0.0 #1737

Closed
Martijn85 opened this issue Jan 9, 2018 · 13 comments
Closed
Assignees
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior controls 🎛️
Milestone

Comments

@Martijn85
Copy link

Martijn85 commented Jan 9, 2018

I'm submitting a...

[ ] 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

UserVoice link

Current behavior

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 behavior

Expected behaviour is that the adaptive grid view centers horizontally as in previous versions.

Minimal reproduction of the problem with instructions

<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" />

Environment

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

@touseefbsb
Copy link

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

@nmetulev nmetulev added bug 🐛 An unexpected issue that highlights incorrect behavior controls 🎛️ labels Jan 11, 2018
@nmetulev nmetulev added this to the v2.2 milestone Jan 11, 2018
@nmetulev
Copy link
Contributor

ping @skendrot

I can verify this is a bug

@touseefbsb
Copy link

@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 :)

@skendrot
Copy link
Contributor

@nmetulev Any reason this was changed? That's what is causing the crash.

@skendrot
Copy link
Contributor

skendrot commented Jan 11, 2018

@touseefbsb Your issue with using ItemContainerStyle is different than this issue

@touseefbsb
Copy link

@skendrot Oh ok thanks for claifying

@skendrot
Copy link
Contributor

@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
Copy link
Contributor

@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.

@Martijn85
Copy link
Author

@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.

@skendrot skendrot self-assigned this Jan 15, 2018
@windowstoolkitbot
Copy link

This issue seems inactive. Do you need help to complete this issue?

@Martijn85
Copy link
Author

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.

@touseefbsb
Copy link

@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 :)

@skendrot
Copy link
Contributor

Yes, there is a work around, but the control shouldn't crash the application. We'll get it fixed.

@skendrot skendrot reopened this Jan 29, 2018
@skendrot skendrot closed this as completed Feb 7, 2018
michael-hawker added a commit to michael-hawker/UWPCommunityToolkit that referenced this issue Feb 22, 2018
@ghost ghost locked as resolved and limited conversation to collaborators Nov 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior controls 🎛️
Projects
None yet
Development

No branches or pull requests

5 participants