This is a migrated thread and some comments may be shown as answers.

RadTileView UpdateLayout not working

5 Answers 270 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Ricardo
Top achievements
Rank 1
Ricardo asked on 09 Aug 2018, 04:16 PM

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?

5 Answers, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 13 Aug 2018, 11:56 AM
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.
0
Ricardo
Top achievements
Rank 1
answered on 14 Aug 2018, 08:34 AM

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.

0
Accepted
Stefan
Telerik team
answered on 16 Aug 2018, 09:29 AM
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.
0
Michael
Top achievements
Rank 1
answered on 05 Nov 2019, 08:20 PM
I'm trying to do something similar.  I don't know what it means to "modifying the MeasureOverride and ArrangeOverride methods".  I'm not sure what to put there to make the bound items show.  I can send my test project.  Thanks.
0
Martin Ivanov
Telerik team
answered on 08 Nov 2019, 10:58 AM

Hello Michael,

Overriding the MeasureOverride and ArrangeOverride methods of TileViewPanel will allow you to implement a completely custom logic that sizes and arranges the tileview items. However, if you need a more specific information on this, I would suggest to open a new support ticket from your telerik.com account and send your project there. This way the support team can research your case and suggest a solution.

Regards,
Martin Ivanov
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.
Tags
TileView
Asked by
Ricardo
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Ricardo
Top achievements
Rank 1
Michael
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or