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

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

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