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

Layout Cycle Detected error when using RadGridView in RadDocking

6 Answers 355 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 28 May 2009, 10:51 AM
Hi folks,

I am using radDocking in our Silverlight2 application. I currently have 2 docked panes of supplementary information.
In the example xaml below these are:  
- radSplitCaseNotes - docked Right; (contains a RadGridView control)
- radSplitCaseDetail - docked Bottom

I also have a floating pane which will act as a context menu.
In the example xaml below:
- radSplitActionMenu - FloatingDockable

The docking panes work fine until I try and dock the ActionMenu floating pane to either the top or bottom of the compass on the docked CaseNotes pane. The pane docks fine but as when I try and undock teh ActionMenu pane again I get a "Layout Cycle Detected" error. It seems to be caused by the RadGridView control. (If I comment the RadGridView control out then it works fine).

I've included a cut-down version of the xaml that reproduces the problem and full details of the error below.
To reproduce the error, dock the Actions floating pane to the top or bottom of the Case Notes pane. Then try to drag it again to undock.

Thanks in advance...
Jonathan

======================================

Error Details:

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MS-RTC LM 8)
Timestamp: Thu, 28 May 2009 09:41:21 UTC

Message: Unhandled Error in Silverlight 2 Application Exception from HRESULT: 0x88000FA8
   at MS.Internal.XcpImports.MethodEx(IntPtr ptr, String name, CValue[] cvData)
   at MS.Internal.XcpImports.MethodEx(DependencyObject obj, String name)
   at MS.Internal.XcpImports.UIElement_UpdateLayout(UIElement element)
   at System.Windows.UIElement.UpdateLayout()
   at Telerik.Windows.Controls.RadDocking.ShowWindow(ToolWindow window)
   at Telerik.Windows.Controls.RadDocking.OpenInToolWindow(RadPaneGroup radPaneGroup)
   at Telerik.Windows.Controls.RadDocking.ShowElement(DragInfoEventArgs e)
   at Telerik.Windows.Controls.RadDocking.OnDragDelta(Object sender, DragInfoEventArgs e)
   at Telerik.Windows.Controls.Docking.DragInfoEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at Telerik.Windows.RadRoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at Telerik.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RadRoutedEventArgs routedEventArgs)
   at Telerik.Windows.RouteItem.InvokeHandler(RadRoutedEventArgs routedEventArgs)
   at Telerik.Windows.EventRoute.InvokeHandlersImpl(Object source, RadRoutedEventArgs args, Boolean raisedAgain)
   at Telerik.Windows.EventRoute.InvokeHandlers(Object source, RadRoutedEventArgs args)
   at Telerik.Windows.RadRoutedEventHelper.RaiseEvent(DependencyObject element, RadRoutedEventArgs args)
   at Telerik.Windows.DependencyObjectExtensions.RaiseEvent(DependencyObject element, RadRoutedEventArgs e)
   at Telerik.Windows.Controls.Docking.PaneHeader.OnMouseMove(MouseEventArgs e)
   at System.Windows.Controls.Control.OnMouseMove(Control ctrl, EventArgs e)
   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)
Line: 1
Char: 1
Code: 0
URI: http://localhost:1595/Default.html

Message: Unhandled Error in Silverlight 2 Application
Code: 4008   
Category: RuntimeError      
Message: Layout cycle detected.  Layout could not complete.    
MethodName:     

Line: 53
Char: 13
Code: 0
URI: http://localhost:1595/Default.html

 
XAML

<UserControl x:Class="MatchOSCases.Page" 
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
             xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"   
             xmlns:basics="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"   
             xmlns:telerikDocking="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Docking" 
             xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
             xmlns:grid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" 
 
          xmlns:uc="clr-namespace:MatchOSCases">  
 
 <Grid x:Name="Modal3MatchOSBorder" RenderTransformOrigin="0.5,0.5" Visibility="Visible" Opacity="1">  
  <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Opacity="0.35" Fill="#FF8A8A8A"/>  
   <Border Width="800" Height="530" Background="White" BorderThickness="1" BorderBrush="Black" CornerRadius="3" HorizontalAlignment="Center" VerticalAlignment="Center" x:Name="border" RenderTransformOrigin="0.5,0.5">  
    <Grid x:Name="FormHolder" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">  
     <Grid.RowDefinitions> 
      <RowDefinition Height="Auto"/>  
      <RowDefinition Height="Auto"/>  
                        <RowDefinition Height="36"/>  
     </Grid.RowDefinitions> 
     <TextBlock x:Name="lblAddValuesForm" Text="Match Outstanding Cases" FontSize="20" FontWeight="Bold" FontFamily="Trebuchet MS" Foreground="#FF00B0CA" Grid.Row="0" Margin="8,8,0,8"/>  
     <telerikDocking:RadDocking Grid.Row="1" > 
      <telerikDocking:RadDocking.DocumentHost> 
                            <telerikDocking:RadSplitContainer x:Name="radModal3SplitDocumentHost">  
                                <telerikDocking:RadPaneGroup> 
                                    <telerikDocking:RadDocumentPane> 
                                        <Grid x:Name="gridMatchOSDataGrid" HorizontalAlignment="Left" VerticalAlignment="Top">  
                                          <data:DataGrid HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Row="1" MinHeight="200" AutoGenerateColumns="False">  
                                            <data:DataGrid.Columns> 
                                                 <data:DataGridTextColumn Header="System Reference" /> 
                                                 <!-- Binding="{Binding $$}" /> --> 
                                                 <data:DataGridTextColumn Header="Reference 1" /> 
                                                 <!-- Binding="{Binding $$}" --> 
                                                 <data:DataGridTextColumn Header="Task" /> 
                                                 <!-- Binding="{Binding $$}" --> 
                                                 <data:DataGridTextColumn Header="Description" /> 
                                                 <!-- Binding="{Binding $$}" --> 
                                                 <data:DataGridTextColumn Header="Volume" /> 
                                                 <!-- Binding="{Binding $$}" --> 
                                                 <data:DataGridTextColumn Header="Target Date" /> 
                                                 <!-- Binding="{Binding $$}" --> 
                                                 <data:DataGridTextColumn Header="Team" /> 
                                                 <!-- Binding="{Binding $$}" --> 
                                                 <data:DataGridTextColumn Header="Individual" /> 
                                                 <!-- Binding="{Binding $$}" --> 
                                        </data:DataGrid.Columns>    
                                   </data:DataGrid> 
                              </Grid> 
                                    </telerikDocking:RadDocumentPane> 
                                </telerikDocking:RadPaneGroup> 
                            </telerikDocking:RadSplitContainer> 
                        </telerikDocking:RadDocking.DocumentHost> 
                        <telerikDocking:RadSplitContainer InitialPosition="FloatingDockable" Orientation="Vertical" x:Name="radSplitActionMenu" telerikDocking:RadDocking.FloatingLocation="640, 25" telerikDocking:RadDocking.FloatingSize="150, 200">  
                   <telerikDocking:RadPaneGroup ReorderTabRows="False">  
                       <telerikDocking:RadPane CanUserClose="False" Header="Actions..." CanDockInDocumentHost="False">  
                              <TextBlock Text="Menu Items" Margin="8,8,8,4"/>  
                       </telerikDocking:RadPane> 
                   </telerikDocking:RadPaneGroup> 
               </telerikDocking:RadSplitContainer> 
      <telerikDocking:RadSplitContainer InitialPosition="DockedBottom" x:Name="radSplitCaseDetail" telerikDocking:DockingPanel.InitialSize="800 220" > 
          <telerikDocking:RadPaneGroup> 
           <telerikDocking:RadPane CanUserClose="True" Header="Case Detail" CanDockInDocumentHost="False" x:Name="paneCaseDetail" Height="500">  
            <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">  
          <TextBlock x:Name="lblFormReferences" Text="Case Details"  Foreground="#FF062782" Grid.Row="0" Grid.Column="0" FontWeight="Bold" Margin="0,4,0,0"/>  
                                    </ScrollViewer> 
           </telerikDocking:RadPane> 
          </telerikDocking:RadPaneGroup> 
         </telerikDocking:RadSplitContainer> 
      <telerikDocking:RadSplitContainer InitialPosition="DockedRight" x:Name="radSplitCaseNotes" telerikDocking:DockingPanel.InitialSize="250 300">  
                   <telerikDocking:RadPaneGroup> 
                       <telerikDocking:RadPane CanUserClose="True" Header="Case Notes" CanDockInDocumentHost="False" x:Name="paneCaseNotes">  
                           <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">  
                                     <Grid x:Name="gridCaseNotes">  
                                         <Grid.RowDefinitions> 
                                             <RowDefinition Height="Auto"/>  
                                             <RowDefinition Height="Auto"/>  
                                         </Grid.RowDefinitions> 
                                         <grid:RadGridView x:Name="grdRadCaseNotes" IsReadOnly="True" RowIndicatorVisibility="Collapsed" AutoGenerateColumns="False" ColumnsWidthMode="Fill" Grid.Row="0" BorderThickness="1,1,1,1" Margin="0,0,0,0">  
                                             <grid:RadGridView.Columns> 
                                                 <grid:GridViewColumn HeaderText="ID" Width="50"/>  
                                                 <grid:GridViewColumn HeaderText="Subject" Width="200"/>  
                                                 <grid:GridViewColumn HeaderText="Date" Width="100"/>  
                                             </grid:RadGridView.Columns> 
                                         </grid:RadGridView> 
                                         <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="1">  
                                             <Button Width="75" Height="20" Content="Add" Margin="4,8,2,8" x:Name="btnAdd"/>  
                                             <Button Width="75" Height="20" Content="Print" Margin="2,8,8,8" x:Name="btnPrint"/>  
                                         </StackPanel> 
                                     </Grid> 
                                 </ScrollViewer> 
                       </telerikDocking:RadPane> 
                   </telerikDocking:RadPaneGroup> 
               </telerikDocking:RadSplitContainer> 
     </telerikDocking:RadDocking> 
     <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,8,8">  
      <Button x:Name="btnModal3_BookOut" Content="Book Out" MinWidth="75" Height="20"/>  
      <Button x:Name="btnModal3_Cancel" Content="Cancel" MinWidth="75" Height="20"/>  
     </StackPanel> 
    </Grid> 
   </Border> 
  </Grid> 
</UserControl> 
 

 

 

6 Answers, 1 is accepted

Sort by
0
Accepted
Miroslav Nedyalkov
Telerik team
answered on 28 May 2009, 03:44 PM
Hi Jonathan,

We were able to reproduce the issue and to find the problem - you shouldn't use the Docking control in a layout panel that measures it with the available size with infinite height or width. It will not always crash, but it is not working correctly and it may cause layout cycle. This is not a bug - it is by design as we decided that it doesn't make sense to let the Docking control resize itself.

To work this around, just change the height of the Row that the Docking is positioned from "Auto" to something else and it will work for you.

Regards,
Miroslav Nedyalkov
the Telerik team

Instantly find answers to your questions on the newTelerik Support Portal.
Check out the tipsfor optimizing your support resource searches.
0
Jonathan
Top achievements
Rank 1
answered on 29 May 2009, 07:58 AM
Hi Miroslav,

That sorted it. Thanks again for the fast response.

Jonathan
0
Patrick Lee
Top achievements
Rank 1
answered on 14 Sep 2010, 08:56 PM
What if my application need to use 100% of the browser window?  I tried to set the height of the grid row that contains the RadDocking control, but I'm still getting this error.  Is this something you can fix in the later release or through hotfix?
0
Miroslav Nedyalkov
Telerik team
answered on 16 Sep 2010, 08:02 AM
Hi Patrick,

 Could you please share with us your scenario? If you could share your XAML of the page that contains the Docking control and a detailed explanation of the goal (how the Docking control should be laid out) this would help us better understand the matter and assist you further.

Kind regards,
Miroslav Nedyalkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Lilia
Top achievements
Rank 1
answered on 07 Apr 2011, 04:20 PM
Hello,
I have the same error with my application:
Line: 56
Error: Unhandled Error in Silverlight Application
Code: 4008   
Category: RuntimeError      
Message: Layout cycle detected.  Layout could not complete.    
MethodName:     

Although I'm using RadTileView control. The error is not thrown every time but from time to time. Can you give me any sugestions for this? Should I place my code here (it's pretty large).
0
Miroslav Nedyalkov
Telerik team
answered on 13 Apr 2011, 09:09 AM
Hello Liliah,

 We are not aware of such problem in general, so need some more information. Could you please share with us some more details about your project and the situations when this problem occurs?
- What contains the page that causes the problems and how are the elements related? The XAML of the page would help a lot.
- When the problem occurs? You mentioned it doesn't happen every time - did you observed specific scenarios that causes the problem?

This information will help us to try to reproduce the problem and better assist you to resolve it. If you could also send us a sample project that reproduces the issue this would be of great help!

Regards,
Miroslav Nedyalkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Docking
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Jonathan
Top achievements
Rank 1
Patrick Lee
Top achievements
Rank 1
Lilia
Top achievements
Rank 1
Share this question
or