autoFitColumn property issue

component : Syncfusion data grid
version : ej2
platform : ReactJS

I want to make the columns of datagrid autofit based on the content of the cell. For which i found autoFitColumn method does the job for the same. But i found one issue with that. The issue is that the column is getting fit based on the content size but column header is not fitting according to the length of column header.

Example :

Suppose we have a column name "petal_length" and its value is any integer between 1 to 10. Because the length of content is less here, so the width of column is correct according to the content but the text of column header is getting wrapped i.e, it is shown like "petal_l....". So is there any other method other than autoFitColumn which can do the job or suggest any other method of implementation. Also it will be good if you can give us small example with the code.





1 Reply 1 reply marked as answer

VS Vignesh Sivagnanam Syncfusion Team February 4, 2021 01:22 PM UTC

Hi Prithivinath 

Greetings From Syncfusion support 

Based on your query we found that you are facing issue while autofit the columns in the grid. So, we have prepared a sample by autofitting the grid column with the menu filter but we did not face the mentioned issue at our end. 

Please refer the below Sample for your reference, 


If you are still facing the issue, kindly share the following details that will be helpful for us to provide better solution. 

  1. Please share the full grid Rendering Code.

  1. If possible please replicate the issue in the attached sample. 

  1. Syncfusion Package Version.

Regards 
Vignesh Sivagnanam 


Marked as answer
Loader.
Up arrow icon