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

Example estoredTilesToSpanMultipleRowsAndColumns not working without defining number of rows

2 Answers 14 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Ricardo
Top achievements
Rank 1
Ricardo asked on 12 Aug 2018, 04:20 PM

Hi,

I'm following the example of RestoredTilesToSpanMultipleRowsAndColumns_WPF on the provided developer examples and i have stumbled upon 2 problems:

  1. This example doesn't work without defining the RowsCount, i.e., trying to use an infinite number of rows:
<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>

 

Error:

System.InvalidOperationException
  HResult=0x80131509
  Message=Cannot call Arrange on a UIElement with infinite size or NaN. Parent of type 'RestoredTilesToSpanMultipleRowsAndColumns.MultipleRowsAndColumnsPanel' invokes the UIElement. Arrange called on element of type 'Telerik.Windows.Controls.RadTileViewItem'.
  Source=PresentationCore
  StackTrace:
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at RestoredTilesToSpanMultipleRowsAndColumns.MultipleRowsAndColumnsPanel.ArrangeOverride(Size finalSize) in ...\RestoredTilesToSpanMultipleRowsAndColumns\MultipleRowsAndColumnsPanel.cs:line xx
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize)
   at System.Windows.Controls.ItemsPresenter.ArrangeOverride(Size arrangeSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.ScrollContentPresenter.ArrangeOverride(Size arrangeSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Border.ArrangeOverride(Size finalSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds)
   at System.Windows.Controls.ScrollViewer.ArrangeOverride(Size arrangeSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Border.ArrangeOverride(Size finalSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Border.ArrangeOverride(Size finalSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize)
   at System.Windows.Controls.ContentPresenter.ArrangeOverride(Size arrangeSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Documents.AdornerDecorator.ArrangeOverride(Size finalSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Controls.Border.ArrangeOverride(Size finalSize)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Window.ArrangeOverride(Size arrangeBounds)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.Interop.HwndSource.SetLayoutSize()
   at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
   at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
   at System.Windows.Window.SetRootVisual()
   at System.Windows.Window.SetRootVisualAndUpdateSTC()
   at System.Windows.Window.SetupInitialState(Double requestedTop, Double requestedLeft, Double requestedWidth, Double requestedHeight)
   at System.Windows.Window.CreateSourceWindow(Boolean duringShow)
   at System.Windows.Window.CreateSourceWindowDuringShow()
   at System.Windows.Window.SafeCreateWindowDuringShow()
   at System.Windows.Window.ShowHelper(Object booleanBox)
   at System.Windows.Window.Show()
   at System.Windows.Window.ShowDialog()

 

 2. Using this template, doesn't allow loading on an Window_LoadedEvent:

public MainWindow()
        {
            InitializeComponent();
        }
 
private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            GenerateTiles();
        }

Result:

When i remove the template from the radtileview, both problems  disappear, but i cannot define the placement of items, i.e., Row, RowSpan, Column and ColumnSpan don't work anymore:

Example 1:

<telerik:RadTileView x:Name="MyRadTileView">
                <telerik:RadTileViewItem Content="test"  local:TileViewAttachedProperties.Row="0" local:TileViewAttachedProperties.Column="2"/>
                <telerik:RadTileViewItem Content="test2"   local:TileViewAttachedProperties.Row="0" local:TileViewAttachedProperties.Column="0"/>
                <telerik:RadTileViewItem Content="test3"  local:TileViewAttachedProperties.Row="0" local:TileViewAttachedProperties.Column="1"/>
</telerik:RadTileView>
 

 

Result:

I can surpass this problem by using Position property of radtileviewitem, but there is a problem when an item's size is bigger, i.e., when i want an item to either span more than 1 row/column.

In resume, i need a way to either use the Multicolumns template with infinite rows, or a way to continue without the template but being able to define the position of each item, even when an item occupies more than 1 row/column.

Can anyone help me?

 

Regards

 

2 Answers, 1 is accepted

Sort by
0
Ricardo
Top achievements
Rank 1
answered on 14 Aug 2018, 08:36 AM

Hi,

 

I manage to solve the 2nd problem  by placing the RadTileView inside a border and then clearing and adding it on the event.

see link: https://www.telerik.com/forums/radtileview-updatelayout-not-working#QLGFGLVKqkK-lQxpxFizVg

So now i just need to figure a way to use infinite rows.

I also have another question, how can i get the rows/columns that are still free in the radtileview?

 

0
Accepted
Ricardo
Top achievements
Rank 1
answered on 14 Aug 2018, 08:38 AM

Hi,

 

I manage to solve the 2nd problem by putting the RadTileView inside a border and then on the event clearing and adding it to the border. See link: https://www.telerik.com/forums/radtileview-updatelayout-not-working#QLGFGLVKqkK-lQxpxFizVg

 

So now i just need a way to use infinite rows.

 

I also have another question, how can i obtain the rows/columns that are still free in the radtileview?

 

Regards

Tags
TileView
Asked by
Ricardo
Top achievements
Rank 1
Answers by
Ricardo
Top achievements
Rank 1
Share this question
or