BestFitColumns strange behavior

4 posts, 0 answers
  1. Andrea Gironi
    Andrea Gironi avatar
    2 posts
    Member since:
    Oct 2018

    Posted 04 Dec 2018 Link to this post

    Hello,

    I have two RadGridView bound to two different Lists, on two different tabs of a tab control; I DeferRefresh, set the data source, set AutoSize columns mode to none and then call BestFitColumns

    The second grid, containing just two example rows, gets its columns resized as expected, but not the first that looks like nothing happened.

    The strange behavior is that, if I manually resize (aka click the corner of the window and drag) even just of some pixels the WinForm where the tabs and the grids are staying, the columns gets refreshed to the best fit, as expected from the BestFitColumns command, somehow like it was not refreshed after the bind. This grid have 60 rows, not so many, both Lists contains the same class, so the amount of columns is the same; both grids have the same attributes.

    Any idea?

    Thank you in advance

    Best regards

  2. Dimitar
    Admin
    Dimitar avatar
    2841 posts

    Posted 05 Dec 2018 Link to this post

    Hello Andrea,

    These actions (setting data source, best-fit columns) should not be done in a DefferRefresh block. We are aware that these are expensive operations and we are doing the necessary to impact the performance at a minimum. Could you remove this block and see if the result is different?

    I am looking forward to your reply.
     
    Regards,
    Dimitar
    Progress Telerik
    Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  3. Andrea Gironi
    Andrea Gironi avatar
    2 posts
    Member since:
    Oct 2018

    Posted 06 Dec 2018 in reply to Dimitar Link to this post

    Hello Dimitar,

    I have added the DeferRefresh after some searches I have done in your forums and over Google, but the problem was (and is) there before that.

    Removing the defer block is still resulting in the strange behavior, if i manually drag and resize the window, the grid gets refreshed and the columns gets bestfitted, while the second grid is already bestfitted

    Thank you for your kind attention

    Best regards

  4. Dimitar
    Admin
    Dimitar avatar
    2841 posts

    Posted 06 Dec 2018 Link to this post

    Hi Andrea,

    I have tested this and it works on my side. I have attached my test project. Could you please check it and let me know how it differs from your real setup? 

    I am looking forward to your reply.

    Regards,
    Dimitar
    Progress Telerik
    Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top