RadTileView UpdateLayout not working

4 posts, 2 answers
  1. Ricardo
    Ricardo avatar
    44 posts
    Member since:
    May 2018

    Posted 09 Aug 2018 Link to this post

    Hi,

     

    I'm trying to fill my RadTileView on an event Window_Loaded.

    The form updates ok in terms of code, but visualualy it remains empty and i have no idea why:

    private void Window_Loaded(object sender, RoutedEventArgs e)
            {
                MyRadtileView.Items.Clear();
                MyRadtileView.Items.Add(new RadTileViewItem()
                {
                    Header = "test"
                });
     
                MyRadtileView.UpdateLayout();
            }

     

    Result:

     

     

    Can anyone help me?

  2. Answer
    Stefan
    Admin
    Stefan avatar
    1073 posts

    Posted 13 Aug 2018 Link to this post

    Hello Ricardo,

    Although I am not aware of the exact cause for the UI not to be updated, can you please take a look at the Add Close Button SDK Example? It demonstrates the exact same approach and in it the control is updated as expected. Am I missing something?

    Regards,
    Stefan
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Ricardo
    Ricardo avatar
    44 posts
    Member since:
    May 2018

    Posted 14 Aug 2018 in reply to Stefan Link to this post

    Hi Stefan,

    This problem only occurs when using the RestoredTilesToSpanMultipleRowsAndColumns_WPF, for some reason the usage of a template in the items panel prevents the update (see link: https://www.telerik.com/forums/example-estoredtilestospanmultiplerowsandcolumns-not-working-without-defining-number-of-rows#HEaATYDMc0W6V7zbYneiIA).

     

    I manage to solve this problem by putting the RadTileView inside a border and clearing and adding the RadTileView form the border:

    <Border x:Name="GridBorder">
    <telerik:RadTileView x:Name="MyRadTileView">
                    <telerik:RadTileView.ItemsPanel>
                     <ItemsPanelTemplate>
                        <local:MultipleRowsAndColumnsPanel ColumnsCount="3"/>
                    </ItemsPanelTemplate>
                </telerik:RadTileView.ItemsPanel>
                    <telerik:RadTileViewItem Content="test"  local:TileViewAttachedProperties.Row="0" local:TileViewAttachedProperties.Column="0"/>
                    <telerik:RadTileViewItem Content="test2"   local:TileViewAttachedProperties.Row="0" local:TileViewAttachedProperties.Column="1"/>
                    <telerik:RadTileViewItem Content="test3"  local:TileViewAttachedProperties.Row="0" local:TileViewAttachedProperties.Column="2"/>
    </telerik:RadTileView>
    </Border>

     

    In the event:

    private void Window_ContentRendered(object sender, EventArgs e)
    {
           GridBorder.Child = null;
           GenerateTiles(); // updates MyRadTileView;
           GridBorder.Child = MyRadTileView;
    }

     

    But i shouldn't need to do this to update the layout.

  4. Answer
    Stefan
    Admin
    Stefan avatar
    1073 posts

    Posted 16 Aug 2018 Link to this post

    Hi Ricardo,

    Thank you for the clarification.

    Firstly, I would like to clarify that our SDK Examples are intended to demonstrate how particular developer solutions can be implemented. Despite that we are aiming at implementing them in the most generic way, there is no guarantee that they will be working as expected in all scenarios different from the demonstrated one. In various use cases the implementation of an example needs to be modified in order to fit the  given requirements.

    So, apart from the workaround that you have found, you can also try modifying the MeasureOverride and ArrangeOverride methods in the customized TileViewPanel so that your requirement is supported.

    Regards,
    Stefan
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top