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

Stacked column header wrap text


How can I wrap header text in the Stacked Column header? or show text in a smaller font when it doesn't fit in the provided column width? 


3 Replies

FP Farjana Parveen Ayubb Syncfusion Team June 5, 2015 09:52 AM UTC

Hi Vasanth,

Thank you for contacting Syncfusion support.

We have analyzed the reported query and you can achieve this by customizing the GridStackedHeaderCellControl in SfDataGrid.

Please refer the below code snippet and sample in the following location:

Code Snippet:

        <Style TargetType="syncfusion:GridStackedHeaderCellControl">

            <Setter Property="Template">


                    <ControlTemplate TargetType="syncfusion:GridStackedHeaderCellControl">

                        <Border Background="{TemplateBinding Background}"

                            BorderBrush="{TemplateBinding BorderBrush}"

                            BorderThickness="{TemplateBinding BorderThickness}">

                            <Grid Margin="{TemplateBinding Padding}">

                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"

                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}"

                                              FontFamily="{TemplateBinding FontFamily}"

                                              FontSize="{TemplateBinding FontSize}"

                                              FontWeight="{TemplateBinding FontWeight}">

                                            <TextBlock Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Content}"    TextWrapping="Wrap"/>







Sample Location: StackedHeader_TextWraping

Farjana Parveen A

VA Vasanth June 5, 2015 02:45 PM UTC

Awesome, thank you. Worked like a champ!

SC Saranya CJ Syncfusion Team June 8, 2015 05:28 AM UTC

Hi Vasanth,
Thank you for your update. Please let us know if you require any other assistance on this.

Live Chat Icon For mobile
Up arrow icon