Layout Cycle Detected error when using RadGridView in RadDocking

7 posts, 1 answers
  1. Jonathan
    Jonathan avatar
    13 posts
    Member since:
    May 2009

    Posted 28 May 2009 Link to this post

    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

    1 <UserControl x:Class="MatchOSCases.Page" 
    2              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    3              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    4              xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"   
    5              xmlns:basics="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"   
    6              xmlns:telerikDocking="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Docking" 
    7              xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
    8              xmlns:grid="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" 
    9  
    10           xmlns:uc="clr-namespace:MatchOSCases">  
    11  
    12  <Grid x:Name="Modal3MatchOSBorder" RenderTransformOrigin="0.5,0.5" Visibility="Visible" Opacity="1">  
    13   <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Opacity="0.35" Fill="#FF8A8A8A"/>  
    14    <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">  
    15     <Grid x:Name="FormHolder" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">  
    16      <Grid.RowDefinitions> 
    17       <RowDefinition Height="Auto"/>  
    18       <RowDefinition Height="Auto"/>  
    19                         <RowDefinition Height="36"/>  
    20      </Grid.RowDefinitions> 
    21      <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"/>  
    22      <telerikDocking:RadDocking Grid.Row="1" > 
    23       <telerikDocking:RadDocking.DocumentHost> 
    24                             <telerikDocking:RadSplitContainer x:Name="radModal3SplitDocumentHost">  
    25                                 <telerikDocking:RadPaneGroup> 
    26                                     <telerikDocking:RadDocumentPane> 
    27                                         <Grid x:Name="gridMatchOSDataGrid" HorizontalAlignment="Left" VerticalAlignment="Top">  
    28                                           <data:DataGrid HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Row="1" MinHeight="200" AutoGenerateColumns="False">  
    29                                             <data:DataGrid.Columns> 
    30                                                  <data:DataGridTextColumn Header="System Reference" /> 
    31                                                  <!-- Binding="{Binding $$}" /> --> 
    32                                                  <data:DataGridTextColumn Header="Reference 1" /> 
    33                                                  <!-- Binding="{Binding $$}" --> 
    34                                                  <data:DataGridTextColumn Header="Task" /> 
    35                                                  <!-- Binding="{Binding $$}" --> 
    36                                                  <data:DataGridTextColumn Header="Description" /> 
    37                                                  <!-- Binding="{Binding $$}" --> 
    38                                                  <data:DataGridTextColumn Header="Volume" /> 
    39                                                  <!-- Binding="{Binding $$}" --> 
    40                                                  <data:DataGridTextColumn Header="Target Date" /> 
    41                                                  <!-- Binding="{Binding $$}" --> 
    42                                                  <data:DataGridTextColumn Header="Team" /> 
    43                                                  <!-- Binding="{Binding $$}" --> 
    44                                                  <data:DataGridTextColumn Header="Individual" /> 
    45                                                  <!-- Binding="{Binding $$}" --> 
    46                                         </data:DataGrid.Columns>    
    47                                    </data:DataGrid> 
    48                               </Grid> 
    49                                     </telerikDocking:RadDocumentPane> 
    50                                 </telerikDocking:RadPaneGroup> 
    51                             </telerikDocking:RadSplitContainer> 
    52                         </telerikDocking:RadDocking.DocumentHost> 
    53                         <telerikDocking:RadSplitContainer InitialPosition="FloatingDockable" Orientation="Vertical" x:Name="radSplitActionMenu" telerikDocking:RadDocking.FloatingLocation="640, 25" telerikDocking:RadDocking.FloatingSize="150, 200">  
    54                    <telerikDocking:RadPaneGroup ReorderTabRows="False">  
    55                        <telerikDocking:RadPane CanUserClose="False" Header="Actions..." CanDockInDocumentHost="False">  
    56                               <TextBlock Text="Menu Items" Margin="8,8,8,4"/>  
    57                        </telerikDocking:RadPane> 
    58                    </telerikDocking:RadPaneGroup> 
    59                </telerikDocking:RadSplitContainer> 
    60       <telerikDocking:RadSplitContainer InitialPosition="DockedBottom" x:Name="radSplitCaseDetail" telerikDocking:DockingPanel.InitialSize="800 220" > 
    61           <telerikDocking:RadPaneGroup> 
    62            <telerikDocking:RadPane CanUserClose="True" Header="Case Detail" CanDockInDocumentHost="False" x:Name="paneCaseDetail" Height="500">  
    63             <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">  
    64           <TextBlock x:Name="lblFormReferences" Text="Case Details"  Foreground="#FF062782" Grid.Row="0" Grid.Column="0" FontWeight="Bold" Margin="0,4,0,0"/>  
    65                                     </ScrollViewer> 
    66            </telerikDocking:RadPane> 
    67           </telerikDocking:RadPaneGroup> 
    68          </telerikDocking:RadSplitContainer> 
    69       <telerikDocking:RadSplitContainer InitialPosition="DockedRight" x:Name="radSplitCaseNotes" telerikDocking:DockingPanel.InitialSize="250 300">  
    70                    <telerikDocking:RadPaneGroup> 
    71                        <telerikDocking:RadPane CanUserClose="True" Header="Case Notes" CanDockInDocumentHost="False" x:Name="paneCaseNotes">  
    72                            <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">  
    73                                      <Grid x:Name="gridCaseNotes">  
    74                                          <Grid.RowDefinitions> 
    75                                              <RowDefinition Height="Auto"/>  
    76                                              <RowDefinition Height="Auto"/>  
    77                                          </Grid.RowDefinitions> 
    78                                          <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">  
    79                                              <grid:RadGridView.Columns> 
    80                                                  <grid:GridViewColumn HeaderText="ID" Width="50"/>  
    81                                                  <grid:GridViewColumn HeaderText="Subject" Width="200"/>  
    82                                                  <grid:GridViewColumn HeaderText="Date" Width="100"/>  
    83                                              </grid:RadGridView.Columns> 
    84                                          </grid:RadGridView> 
    85                                          <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" Grid.Row="1">  
    86                                              <Button Width="75" Height="20" Content="Add" Margin="4,8,2,8" x:Name="btnAdd"/>  
    87                                              <Button Width="75" Height="20" Content="Print" Margin="2,8,8,8" x:Name="btnPrint"/>  
    88                                          </StackPanel> 
    89                                      </Grid> 
    90                                  </ScrollViewer> 
    91                        </telerikDocking:RadPane> 
    92                    </telerikDocking:RadPaneGroup> 
    93                </telerikDocking:RadSplitContainer> 
    94      </telerikDocking:RadDocking> 
    95      <StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,8,8">  
    96       <Button x:Name="btnModal3_BookOut" Content="Book Out" MinWidth="75" Height="20"/>  
    97       <Button x:Name="btnModal3_Cancel" Content="Cancel" MinWidth="75" Height="20"/>  
    98      </StackPanel> 
    99     </Grid> 
    100    </Border> 
    101   </Grid> 
    102 </UserControl> 
    103  

     

     

  2. Answer
    Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 28 May 2009 Link to this post

    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.
  3. DevCraft banner
  4. Jonathan
    Jonathan avatar
    13 posts
    Member since:
    May 2009

    Posted 29 May 2009 Link to this post

    Hi Miroslav,

    That sorted it. Thanks again for the fast response.

    Jonathan
  5. Patrick Lee
    Patrick Lee avatar
    1 posts
    Member since:
    Dec 2008

    Posted 14 Sep 2010 Link to this post

    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?
  6. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 16 Sep 2010 Link to this post

    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
  7. Lilia
    Lilia avatar
    32 posts
    Member since:
    Mar 2011

    Posted 07 Apr 2011 Link to this post

    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).
  8. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 13 Apr 2011 Link to this post

    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
Back to Top
DevCraft banner