Gridview starts off messy then corrects itself RRS feed

  • Question

  • I populate a GridView with some data, but it displays with the items in a random/messy layout before (after about 1 second) re-arranging to the correct grid layout. What could be causing this? It makes my app look terrible.

    Here's what my grid looks like when the app first launches (note: the data is already populated - the coloured squares are a representation of the data):

    messy gridview layout

    After a second, the layout updates to the correct look automatically:

    Here is the data template:

        <DataTemplate x:Key="IconTemplate">
            <Grid Width="60" Height="60" Margin="6"  >       
                <Grid Visibility="{Binding IsVisible}" Background="{Binding BgColour}">

    Pretty simple - it just binds to a background colour for the internal grid.

    The data binding doesn't do anything unusual (in OnNavigatedTo):

      ItemsGrid.ItemsSource = ThisMatch.CurrentPlayer.Items;

    Why doesn't my GridView layout look correct when the page first loads?

    I'm a self-taught noob amateur. Please take this into account when responding to my posts or when taking advice from me.

    Monday, December 22, 2014 5:34 AM

All replies

  • Did you use any "Transition" on your GridView ?

    Animating content and entrance transitions (XAML)

    在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。

    Monday, December 22, 2014 7:34 AM