Layout Cycle Error when creating TileView Programmatically

6 posts, 0 answers
  1. Don Pruitt
    Don Pruitt avatar
    4 posts
    Member since:
    Jul 2005

    Posted 20 Nov 2009 Link to this post

    I receive the following error when selecting tiles at run time:

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

    I am creating the TileView programmatically with the following:
    RadTileViewItem dashboardItem = new RadTileViewItem();  
                 dashboardItem.Name = "Tile";  
                 dashboardItem.Header = "Tile";  
                 //dashboardItem.Content = "Tile Content";  
                 dashboardItem.Height = 100;  
                 dashboardItem.Width = 100;  
     
                 RadFluidContentControl fluidContentControl = new RadFluidContentControl();  
     
                 fluidContentControl.LargeContent = "This is the larger contant.  We can display charts and a whole lot more.";  
                 fluidContentControl.SmallContent = "Small Content";  
                 fluidContentControl.SmallToNormalThreshold = new Size(100, 75);  
                 fluidContentControl.NormalToSmallThreshold = new Size(101, 76);  
                 fluidContentControl.NormalToLargeThreshold = new Size(400, 200);  
                 fluidContentControl.LargeToNormalThreshold = new Size(401, 201);  
     
                 dashboardItem.Content = fluidContentControl;  
     
                 RadTileView dashboard = _container.Resolve<RadTileView>("MainDashboard");  
     
                 dashboard.Items.Add(dashboardItem);  
                 dashboard.ReorderingEasing = new System.Windows.Media.Animation.ElasticEase();   
                 dashboard.ResizingEasing = new System.Windows.Media.Animation.ExponentialEase();  
    If I remove the Fluid Content Control, everyhting works, but I am am forced to have the same content on each display.  If I include the Fluid Content Control, I get the error when selecting the first small tile to enlarge.

    Thanks.
    RadMenuItem studentMenuItem = new RadMenuItem();  
                 studentMenuItem.Name = "Student";  
                 studentMenuItem.Header = "Student";  
     
                 RadMenuItem studentAdd = new RadMenuItem();  
                 studentAdd.Name = "Add Student";  
                 studentAdd.Header = "Add Student";  
     
                 studentMenuItem.Items.Add(studentAdd);  
     
                 RadMenuItem studentUpdate = new RadMenuItem();  
                 studentUpdate.Name = "Update Student";  
                 studentUpdate.Header = "Update Student";  
     
                 studentMenuItem.Items.Add(studentUpdate);  
     
                 RadMenu menu = _container.Resolve<RadMenu>("MainMenu");  
                 menu.Items.Add(studentMenuItem); 
    Disregard the Menu Code.
  2. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 25 Nov 2009 Link to this post

    Hi Don,

    Thank you for your feedback. What you observed is a known bug which we will be working on for the upcoming service pack. However, you can use an alternative way of switching the visible content of the FluidContentControl which is demonstrated in the attached project. It is basically showing how to manually change the visible content every time a tile changes its state. Besides that, the attached sample uses DataTemplates which you may found more convenient than using code to create the wrapping FluidContentControls and set tile properties. Please take a look at the project and let me know if it will work for you.

    All the best,
    Tihomir Petkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. Ludovic Gerbault
    Ludovic Gerbault avatar
    226 posts
    Member since:
    Apr 2009

    Posted 18 Jan 2010 Link to this post

    I just want to let you know that the bug that is being refered to here still exists in Q3 SP2.

    I've been able to get it by adding dynamically in the LargeContent of the RadFluidContentControl a stackpanel which contains a coverflow and a RadExpander.

    After that, any state change would cause the exception.

    Thanks for the workaround, it works great.
  5. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 21 Jan 2010 Link to this post

    Hi Subileau,

    I was not able to reproduce the problem you reported. Can you please modify the sample project that I prepared to reproduce the errors?

    Kind regards,
    Tihomir Petkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Ludovic Gerbault
    Ludovic Gerbault avatar
    226 posts
    Member since:
    Apr 2009

    Posted 21 Jan 2010 Link to this post

    I've modified your code to reproduce what I was trying to do at first.

    I'm not getting the error per se, but actually, Firefox 3.6 beta RC2 and IE 8 are crashing as soon as the TileViewItem changes state, I'm uploading the projet in a support ticket

    Regards
  7. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 21 Jan 2010 Link to this post

    Hello Subileau,

    OK, we will continue this conversation in the support ticket you will open.

    Sincerely yours,
    Tihomir Petkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Back to Top
DevCraft banner