Fit the Row Height based on its content

Hi,
I've implemented auto row height sizing based on this article https://help.syncfusion.com/wpf/datagrid/row-height-customization?cs-save-lang=1&cs-lang=csharp#fit-the-row-height-based-on-its-content. But it seems that GridColumnSizer.GetAutoRowHeight function returns wrong size in edge positions.
The row is higher then needed just before the content is wrapped. See attached images. The difference is just a few pixels of column width.

Can you reproduce this behavior?

Thanks!

Attachment: images_cb7a4879.zip

14 Replies

VS Vijayarasan Sivanandham Syncfusion Team May 18, 2020 07:12 PM UTC

Hi Ondrej Svoboda,

Thank you for contacting Syncfusion support.

We have checked the reported issue in simple sample and unable to replicate the issue from our end. Please find the tested sample and video demo from our end in the below link,

Sample Link: https://www.syncfusion.com/downloads/support/directtrac/154286/ze/Sample-860811379
 

Can you please share us below things?
       
        1. Brief replication procedure/video illustration of the reported issue
 

       
if you still facing the same issue? If yes, please modify the sample based on your scenario. 

Regards,
Vijayarasan S
 



OS Ondrej Svoboda May 19, 2020 06:32 AM UTC

Hi, I'm not able to download the files because: You don’t have permission to access this file.


VS Vijayarasan Sivanandham Syncfusion Team May 19, 2020 07:32 AM UTC

Hi Ondrej Svoboda,

Sorry for the inconvenience caused.

Please download the sample and video from below link,

Sample Link: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Sample-518881158 
Regards,
Vijayarasan S 



OS Ondrej Svoboda May 20, 2020 12:17 PM UTC

Hi,
attached is slightly modified demo and video showing the issue.

You can see there that the first line is getting higher a little while before it actually needs to be wrapped. The same is happening in the end when column sizer is double clicked - to set the width automatically, but the height is also increased even though it is not needed.

Please check

Attachment: capture_9ea309e1.zip


OS Ondrej Svoboda May 20, 2020 12:18 PM UTC

Attaching modified demo.

Attachment: Sample518881158_68bd4447.zip


VS Vijayarasan Sivanandham Syncfusion Team May 22, 2020 01:21 AM UTC

Thanks for the update.

 
We could able to reproduce your reported issue from our end. Currently, we are checking the feasibility to fix this issue from our end. We will validate and update you details on May 26, 2020. 
 
We appreciate your patience until then. 
 
Regards, 
Vijayarasan S 



VS Vijayarasan Sivanandham Syncfusion Team May 26, 2020 04:31 PM UTC

Hi Ondrej Svoboda, 
Sorry for the inconvenience caused. 
We are currently working on this and we need two more business days to validate this. We will update you with further details on May 28, 2020. 
We appreciate your patience until then.  
Regards, 
Vijayarasan S 



OS Ondrej Svoboda May 29, 2020 09:27 AM UTC

Hi,
is there anything new about this issue?

Thanks


SS Susmitha Sundar Syncfusion Team June 2, 2020 02:30 AM UTC

Hi Ondrej Svoboda,  
 
Thank you for your patience.  
 
We are trying resolve your reported case by workaround. But we are facing some issues. Currently, we are working on this with high priority. We will update you with details on June 3, 2020.  
We appreciate your patience until then.   
 
Regards,  
Susmitha S 
 



SS Susmitha Sundar Syncfusion Team June 4, 2020 07:24 AM UTC

Hi Ondrej Svoboda, 
 
Thank you for your patience. 
 
We have prepared the work around for your reported issue. Please refer the below code, 
 
this.sfDataGrid.GridColumnSizer = new GridColumnSizerExt(sfDataGrid); 
 
public class GridColumnSizerExt : GridColumnSizer 
{ 
    SfDataGrid sfDataGrid; 
    public GridColumnSizerExt(SfDataGrid dataGrid) 
        : base(dataGrid) 
    { 
        sfDataGrid = dataGrid; 
    } 
 
    protected override Size MeasureText(Size rectangle, string displayText, GridColumn column, object record, GridQueryBounds queryBounds) 
    { 
        if (queryBounds == GridQueryBounds.Height) 
            sfDataGrid.GridColumnSizer.Margin = new Thickness(3, 1, 3, 1); 
        else if (queryBounds == GridQueryBounds.Width) 
            sfDataGrid.GridColumnSizer.Margin = new Thickness(5, 1, 5, 1); 
 
        return base.MeasureText(rectangle, displayText, column, record, queryBounds); 
        
    } 
} 
 
 
Please check the sample and let us know if you need further assistance on this. 
 
Regards, 
Susmitha S 



OS Ondrej Svoboda June 8, 2020 09:26 AM UTC

Hi, thanks I'll test it.
Do you plan to fix this in your package?


OS Ondrej Svoboda June 8, 2020 01:00 PM UTC

I can confirm this workaround works. Would be nice to have this fixed in your code.

One more thing, is there a way how to set GridColumnSizer.FontFamily globally for the whole app? Or I need to set it for all grids individually? 



VS Vijayarasan Sivanandham Syncfusion Team June 9, 2020 04:40 PM UTC

Hi Ondrej Svoboda,

Thanks for the update.

Please find answer for your queries below 
Queries 
Solutions 
 I can confirm this workaround works. Would be nice to have this fixed in your code. 

We have checking feasibility include fix in our SfDataGrid source architecture
and we will update you the details on June 10, 2020. 
how to set GridColumnSizer.FontFamily globally for the whole app? Or I need to set it for all grids individually?  

Yes you need to set individual grid for SfDataGrid.GridColumnSizer.FontFamily in your application. Please refer the below user documentation for more details,

UG Link: https://help.syncfusion.com/wpf/datagrid/autosize-columns#changing-font-settings-for-one-column

 
 
Regards,
Vijayarasan S
 



VS Vijayarasan Sivanandham Syncfusion Team June 10, 2020 05:29 PM UTC

Hi Ondrej Svoboda,

Thank you for your patience.

Currently, SfDataGrid does not have a support for to calculate the column sizer value based on padding. We have analyzed and considered your requirmenet of “Provide the support to calculate the column sizer value based on padding” in SfDataGrid and logged feature request for the same. We will implement this feature in any of our upcoming release.

At the planning stage for every release cycle, we review all open features and identify features for implementation based on specific parameters including product vision, technological feasibility, and customer interest. We will let you know when this feature is implemented. We appreciate your patience until then. 
 
Thank you for requesting this feature and helping us define it. We are always trying to make our products better and feature requests like yours are a key part of our product growth efforts. 
  
We are closing this incident now. You can also communicate with us regarding the open features any time using our Feature Report page.  
  
Feedback link: https://www.syncfusion.com/feedback/15107/provide-the-support-to-calculate-the-column-sizer-value-based-on-padding-in

If you have any more specification/suggestions to the feature request, you can add is as comment in the portal and cast your vote to make it count. 
  
Regards,
Vijayarasan S 


Loader.
Up arrow icon