Example estoredTilesToSpanMultipleRowsAndColumns not working without defining number of rows

3 posts, 1 answers
  1. Ricardo
    Ricardo avatar
    1 posts
    Member since:
    Aug 2018

    Posted 12 Aug 2018 Link to this post

    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. Ricardo
    Ricardo avatar
    44 posts
    Member since:
    May 2018

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

    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?

     

  3. Answer
    Ricardo
    Ricardo avatar
    44 posts
    Member since:
    May 2018

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

    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

Back to Top