Remove spacing from grid header when sorting is disabled

Hi

Can you tell me how to remove white-space from specific grid-headers? The space appears to be there to allow for a sort / filter icon. In the example below, I wish to remove the white-space from the column labelled "05/01/26", which has filtering and sorting disabled.

Image_5978_1768140056401

Thank you

Dermot


3 Replies

JC Joseph Christ Nithin Issack Syncfusion Team January 12, 2026 04:51 PM UTC


Hi Dermot,


Greetings form Syncfusion support.


Based on your query, you want to remove the space for the sort-filter div which is used to display the sort or the filter icon for filter, sorting disabled columns. By default, the width of the div will be set to 0px when sorting or filtering is disabled in the column. You can also manually hide the div by using the CSS like below.


Please refer the below code example:


 

   .e-sortfilterdiv[aria-hidden='true'] {

        display: none !important;

      }

 


Or if your requirement is to resize the column to fit to the content, you can enable the AutoFit feature of the EJ2 Grid, which allows you to automatically adjust the width of the columns based on the maximum content width each column. Please refer the below documentation for more information about AutoFit columns feature.


Documentation: https://ej2.syncfusion.com/aspnetmvc/documentation/grid/columns/columns#resizing-a-column-to-fit-its-content-using-autofit-method


Regards,

Joseph I.



DH Dermot Heslin January 15, 2026 05:08 PM UTC

Hi Joseph, thank you very much for that.

Regards

Dermot



JC Joseph Christ Nithin Issack Syncfusion Team January 20, 2026 02:03 PM UTC

Hi Dermot,


We are glad the provided solution resolved your query.


Loader.
Up arrow icon