We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SfDataGrid Layout cycle detected when using screen scale and resizing the application


I'm gonna try to explain this as best as I can, also I'll be adding a video to demostrate the error better, how to break the app and the sample app which I used.

A bit of story:
First of all, I want to say that this was tricky to find on our big application and at first glance we didn't know what was happening and why on some of our working laptops the application was crashing and on other didn't. After a lot of testing and seeing all our different configurations we noticed something on the laptops with issues that they all had a screen scale of 225% (the displays are 4k, that's why the big scale) while the others had 250%. So we changed one of the laptops which had 250% to 225%, and the app crashed.
After more testing, we created a sample app to test even further the issue and see which of the controls was breaking everything, we had on the same page 2 controls, SfDataGrid, SfChart. We ruled out first the grid, and it didn't crash testing, so we knew it was our datagrid. After looking at the problem even further we've seen that we used a margin of 6 on the datagrid instead of 4 or 8, so we changed it to 4 and tested it again, the app didn't break, we changed it to 5, and the app broke.

How to reproduce the issue and requirements:
To reproduce the issue we need:
  1. A SfDataGrid control.
  2. Set it's Margin to any value which is NOT multiple of 4.
  3. Set our screen scale of windows to anything ending in 25 or 75, for example: 125%, 175%, 225%, 275%, etc. You can do this in Win10 by going to the Desktop > Right click in the desktop > Display settings > Scale and Layout
  4. Run the application.
  5. Resize the width of the application.
Video showing the issue:

Info about the video:

Used in first run (minute 0:13 to 0:19):
Windows screen scale 100%
Margin 4
Everything works perfectly, no issue here.

Used in the second run (minute 0:21 to 0:29):
Windows screen scale 100%
Margin 5
Everything works perfectly, no issue here.

Used in the third run (minute 0:34 to 0:41):
Windows screen scale 125%
Margin 4
Everything works perfectly, no issue here.

Used in the fourth run (minute 0:48 to 0:51):
Windows screen scale 125%
Margin 5
This is where we get the "Layout cycle detected.  Layout could not complete.\rLayout cycle detected.  Layout could not complete." error.

I hope this is enough information about the issue and that it can be fixed.
Thanks and have a nice day.

Attachment: SfDataGrid_ResizeCycle_ec55b7d9.zip

1 Reply

MK Muthukumar Kalyanasundaram Syncfusion Team July 6, 2017 03:56 AM UTC

Hi Alexandru,  
We were able to reproduce the issue and have logged defect report regarding this. A support incident to track the status of this defect has been created under your account. Please log on to our support website to check for further updates,  
Please let me know if you have any questions.  
Muthukumar K 

Live Chat Icon For mobile
Up arrow icon