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

Cell and Text Wrapping

Thread ID:





92611 Jan 25,2010 06:26 PM UTC Oct 12,2010 09:11 AM UTC WPF 3
Tags: GridControl
Puthirak OM
Asked On January 25, 2010 06:26 PM UTC


I want the cell to auto wrap a text when a user resize the cell's height.
I tried to set the TextWrapping attribute of the cell style but
that do nothing.

Can you help me ?

Reportive SA

Dhinesh Pandiyan M [Syncfusion]
Replied On February 1, 2010 02:35 PM UTC

Hi Puthirak,

Thanks for using Syncfusion products.

We need to set TextWrapping for Wrap the content. If we need to wrap the content on resizing then We need to listen the ResizingColumns event and call the ResizeRowsToFit() method for make content fit. Use the below code.

grid.Model.IndentColumnStyle.TextWrapping = TextWrapping.Wrap;

void grid_ResizingColumns(object sender, GridResizingColumnsEventArgs args)
{ this.grid.Model.ResizeRowsToFit(GridRangeInfo.Table(), GridResizeToFitOptions.None);

Please download the sample from the below location.


Let us know if you have any other questions.

With Regards,
Dhinesh Pandiyan

Replied On October 1, 2010 09:02 PM UTC


The text wrapping solution wouldn't work when the cell type is RichText. For example having:

myFlowDoc = new FlowDocument();
myFlowDoc.Blocks.Add(new Paragraph(new Run(data)));
gridControl.Model[2, 2].CellValue = myFlowDoc;
gridControl.Model[2, 2].CellType = "RichText";

Is there any way to wrap the text when the type is RichText?

Many Thanks.

Jeraldes J [Syncfusion]
Replied On October 12, 2010 09:11 AM UTC

Hi Paul ,

Sorry for the delay caused. We have created a RichText sample to achieve your requirement. Please download the sample from the following location:

[Sample Link]

In the sample you can find in RichTextBoxCellRenderer we have added CalculatePreferredCellSize method to calculate the richtextbox cell size as per the content.

Let us know if you need any other details.

Jeraldes J


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