DataGrid's cell has wrong height

Hi,

we are experiencing an issue with SfDataGrid at the moment; when the view has a smaller width with a long text inside a column, the grid's row height doesn't increase automatically. The grid looks like this:



Unfortunately, I can't share the code because our codebase is too big but here is some information that you might need:
  • The line break mode is WordWrap
  • Testing environment: Windows 10 PC
  • Installed SfDataGrid NuGet package: 17.3.0.19
  • Xamarin.Forms NuGet package: 4.2.0.910310 
  • Xamarin.Forms.DataGrid NuGet package: 3.1.0

A set of possible solutions that we can try would be enough.

Please let me know if you have any questions.




5 Replies

KK Karthikraja Kalaimani Syncfusion Team March 11, 2020 10:50 AM UTC

Hi Alireza,

Thank you for contacting Syncfusion support.

Your requirement
can be achieved using the SfDatagrid.QueryRowHeight event and the SfDatagrid.GetRowHeight method. The SfDatagrid.QueryRowHeight event returns the row height on demand. The SfDatagrid.GetRowHeight method returns the height of the row based on the content. For more details please refer to the below UG link.

UG link : https://help.syncfusion.com/xamarin/datagrid/row-height-customization#auto-fit-the-grid-rows-based-on-content

We hope this helps, please let us know if need further assistance from us.

Regards,
Karthik Raja
 



AK Alireza Kahaei March 18, 2020 03:19 PM UTC

Hi,

I did use the exact same piece of code you have in the link you shared but the height is not calculated properly:


We actually don't have any special code other than the standard so we see to be a bug in how Synfusion's calculates the row height of the data grid. As we do not like to add a workaround hack in our code please check this and get back to us with the result.


KK Karthikraja Kalaimani Syncfusion Team March 19, 2020 06:02 AM UTC

Hi Alizera,

We have checked the reported issue in SfDataGrid version 17.3.0.19 with Xamarin Forms version 4.2.0.910310 and we are unable to reproduce the in our end and it is working fine as expected. Since we are not aware of your exact application situation, please share the  
following information in order to test it further and have a potential solution sooner.  
 
i) Complete configuration of SfDataGrid.  
 
ii) Can you please replicate the reported issue and provide us with a simple sample if possible.

Simple sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/DataGridDemo-2035202546.zip

Regards,
Karthik Raja 



AK Alireza Kahaei March 19, 2020 11:59 AM UTC

Hi,

just in the sample code you shared change the Data Grid and the Xamarin.Forms package versions to the ones I have mentioned and add a long text for one of the entires and you will see the same issue:




I upgraded the two packages to the latest versions and I still see the same issue.


KK Karthikraja Kalaimani Syncfusion Team March 20, 2020 01:15 PM UTC

Hi Alireza,

Based on your provided steps we have checked the reported issue in latest version of SfDataGrid and Xamarin Forms. Still it is working fine as expected at our end. We have attached the screenshots for your reference. Could you please change the below attached sample based on your scenario and revert us back with clear replication procedure? 


 
 


 
Karthik Raja 


Loader.
Up arrow icon