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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Stacked column header wrap text

Thread ID:

Created:

Updated:

Platform:

Replies:

119323 Jun 4,2015 08:41 PM UTC Jun 8,2015 05:28 AM UTC WinRT 3
loading
Tags: SfDataGrid
Vasanth
Asked On June 4, 2015 08:41 PM UTC

Hi,

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? 

Thanks,
Vasanth

Farjana Parveen Ayubb [Syncfusion]
Replied On 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">

                <Setter.Value>

                    <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"/>

                                </ContentPresenter>

                            </Grid>

                        </Border>

                    </ControlTemplate>

                </Setter.Value>

            </Setter>
        </Style>


Sample Location: StackedHeader_TextWraping

Regards,
Farjana Parveen A

Vasanth
Replied On June 5, 2015 02:45 PM UTC

Awesome, thank you. Worked like a champ!

Saranya CJ [Syncfusion]
Replied On 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.
Regards,
Saranya

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;