Add SelfReferencing best fit column not working

3 posts, 1 answers
  1. Eric Moreau
    Eric Moreau avatar
    48 posts
    Member since:
    Sep 2007

    Posted 26 Aug Link to this post

    Hi

    I have a self referencing grid (using something like .Relations.AddSelfReference(.MasterTemplate, "ID", "IDParent")) and using .BestFitColumns() to automatically adjust columns width. 

    The ID column that contains (the column showing the hierarchy) is not adjusting for all the levels. 

    I needed to set the MinWidth property of the column to try to set a better width.

    Is there something you can do?

  2. Answer
    Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3954 posts

    Posted 27 Aug Link to this post

    Hello, Eric,

    Following the provided information, I was unable to reproduce the issue you are facing. Please refer to the attached gif file illustrating the behavior on my end with the latest version. I have attached my sample project for your reference.

    The BestFitColumns(BestFitColumnMode mode) method allows you to specify the BestFitColumnMode which controls which cells will participate in the calculations for the required space to fit the text. You can find below all available modes:
    - BestFitColumnMode.None - The column's width does not automatically adjust.
    - BestFitColumnMode.AllCells - The column's width adjusts to fit the contents of all cells in the control.
    - BestFitColumnMode.DisplayedDataCells - The column's width adjusts to fit the contents of the displayed data cells.
    - BestFitColumnMode.HeaderCells - The column's width adjusts to fit the contents of the header cell.
    - BestFitColumnMode.FilterCells - The column's width adjusts to fit the contents of the filter cell.
    - BestFitColumnMode.SummaryRowCells - The column's width adjusts to fit the contents of the summary row cell.
    - BestFitColumnMode.DisplayedCells - The column's width adjusts to fit the contents of the displayed cells.

    In case you are still experiencing any further difficulties, please give us some more details how to replicate the issue locally so I can investigate the precise case. Thank you in advance. 

    I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik

    Five days of Blazor, Angular, React, and Xamarin experts live-coding on twitch.tv/CodeItLive , special prizes and more, for FREE?! Register now for DevReach 2.0(20).

  3. Eric Moreau
    Eric Moreau avatar
    48 posts
    Member since:
    Sep 2007

    Posted 27 Aug in reply to Dess | Tech Support Engineer, Sr. Link to this post

    You nailed it! I need to specify AllCells.

    I was calling mygridname.BestFitColumns() but without any arguments.It was working fine for regular columns but not the self-reference one!

    Thanks.

Back to Top