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
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback


Thread ID:





150286 Dec 31,2019 01:43 AM UTC Dec 31,2019 09:15 AM UTC WPF 1
Tags: SfDataGrid
Asked On December 31, 2019 01:43 AM UTC


I'm trying to get the Text to get wrapped in a Datagrid.
I've set up a Style:

<Style x:Key="wrappingText" TargetType="syncfusion:GridCell">
            <Setter Property="TextBlock.TextWrapping" Value="Wrap"/>
            <Setter Property="Background" Value="Aqua"/>

and applied to in c#

if(e.Column is GridTextColumn)
                e.Column.CellStyle = App.Current.Resources["wrappingText"] as Style;

The Background changed, but the wrapping fails.

Thanks in advance


Farjana Parveen Ayubb [Syncfusion]
Replied On December 31, 2019 09:15 AM UTC

Hi Timo, 
Thank you for using Syncfusion controls. 
By default, GridTextColumn having TextWrapping property, so you can set the wrapping for the text using this property. Please refer the below code example 
private void SfDataGrid_Loaded(object sender, RoutedEventArgs e) 
   foreach(var column in sfDataGrid.Columns) 
        if (column is GridTextColumn) 
            (column as GridTextColumn).TextWrapping = TextWrapping.Wrap; 
Please let us know if you need any further details on this. 
Farjana Parveen A 


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon