We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

ColumnSizer calculation

Dear admin,

i faced some issue where the columnsizer doesn't size correctly if i'm setting his property to "Auto", so he should size the column based on cell- or headercontent but if he sized, based on headercontent, the header is always a little bit truncated. I think the problem with this is that i'm using the filter icon and the sorting icon and columnsizer doesn't calculate the width correctly, so i hope you can help me further and solve this problem.

Thanks in advance and best regards.

3 Replies

JN Jayaleshwari N Syncfusion Team January 24, 2019 11:47 AM UTC

Hi Sascha,  
Thanks for contacting Syncfusion Support.  
We have checked the reported query “Column header is truncated when the ColumnSizer is Auto” from our side. we have prepared sample based on the provided information. unfortunately the reported issue does not reproduced at our end. 
You can refer the following user guide documentation link. 
We have attached the tested sample for your reference and you can download the same from the following location. 
Can you please check with the attached sample whether the reported issue reproduced in that also.? Or we would request you to share the following details which would be better to provide appropriate solution as much earliest.   
  • Did you have any customization in your application related to the column sizing in SfDataGrid.If yes then kindly share the code snippets to us. 
  • Did you using HeaderTemplate in your application?  
  • Is there any chance to provide the simple issue reproducible sample.? 
Note: ColumnSizer will not work when the column width defined explicitly. ColumnSizer calculates column width based on MinWidth and MaxWidth properties.          
Jayaleshwari N 

SB Sascha Bauer January 25, 2019 07:12 AM UTC

Hi Jayaleshwari N,

i'm using a headertemplate like the below one:
            <Style TargetType="Syncfusion:GridHeaderCellControl" x:Key="headerStyle">
                <Setter Property="FontWeight" Value="Bold"/>
                <Setter Property="FontSize" Value="{DynamicResource HeaderCellControlFontSize}"/>
                <Setter Property="Foreground" Value="{StaticResource BMW_BABrush_Blue1}"/>
                <Setter Property="Height" Value="{DynamicResource HeaderCellControlHeight}"/>
                <Setter Property="Background" Value="White"/>
                <Setter Property="BorderBrush" Value="DarkGray"/>
                <Setter Property="BorderThickness" Value="{DynamicResource HeaderCellControlBorderThickness}"/>
The columnnames are all written by translationmanager and it all works fine but the only problem i have is at resizing the column by double click on columnseperator or by autosizing so the headers get a little bit truncated. Maybe is there a possibility to redefine the ColumnSizerCalculation only at the Widthproperty of columns so it changes the calculated value + 20 f.e..

JN Jayaleshwari N Syncfusion Team January 28, 2019 10:58 AM UTC

Hi Sascha, 
Thanks for your update.  
We have created a simple sample based on the provided code snippet for header template. But still we are unable to reproduce the reported issue in our sample. You can refer the attached sample from the following link. 
Can you please check with the attached sample whether the reported issue reproduced in that also ? if still the issue exists could you please try reproducing the same issue in the given sample? So that we could find the cause for the issue and provide an exact solution for that. Also provide more information about the translation manager you have specified.  
Jayaleshwari N. 

Live Chat Icon For mobile
Up arrow icon