Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
This repository was archived by the owner on Feb 25, 2026. It is now read-only.

UniformGrid does not behaves well with dynamic changes #2156

Description

@azchohfi

I'm submitting a...

  • Bug report (I searched for similar issues and did not find one)

Current behavior

I've copied the sample code inside the docs (https://docs.microsoft.com/en-us/windows/uwpcommunitytoolkit/controls/uniformgrid) and executed the app. It works as expected, but if I change the values dynamically (the elements Grid.Column and the UniformGrid's Rows properties, for example) they don't give the same result as if I close the app and run it again with the new value.

Expected behavior

The control should reevaluate it's children position correctly if I change it's values.

Minimal reproduction of the problem with instructions

  1. Create a simple UniformGrid.
<controls:UniformGrid Margin="10" Rows="1"
        HorizontalAlignment="Right"
        VerticalAlignment="Bottom">
      <Button Grid.Column="0" Content="No" FontSize="18" Margin="5" Padding="6,3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
      <Button Grid.Column="1" Content="Yes, Absolutely" Margin="5" Padding="6,3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
      <Button Grid.Column="2" Content="Maybe" Margin="5" Padding="6,3" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</controls:UniformGrid>
  1. Debug the project.
  2. With the debugger attached, delete all the XAML's Grid.Column="X".
    Expected result:
    image
    Actual result:
    image

If you restart the project with the new source, the UniformGrid renders as expected.

Environment

Nuget Package(s): Microsoft.Toolkit.Uwp.UI.Controls

Package Version(s): 3.0.0-build.328

Windows 10 Build Number:
- [ ] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [ ] April 2018 Update (17134)
- [X] Insider Build (build number: )

App min and target version:
- [Min] Creators Update (15063)
- [ ] Fall Creators Update (16299)
- [Target] April 2018 Update (17134)
- [ ] Insider Build (xxxxx)

Device form factor:
- [X] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub
- [ ] IoT

Visual Studio 
- [X] 2017 (version: 15.7.2)
- [ ] 2017 Preview (version: )

Metadata

Metadata

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions