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

Cell and Text Wrapping

Thread ID:

Created:

Updated:

Platform:

Replies:

92611 Jan 25,2010 01:26 PM Oct 12,2010 05:11 AM WPF 3
loading
Tags: GridControl
Puthirak OM
Asked On January 25, 2010 01:26 PM

Hi,

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 ?

Thanks,
P.OM
Reportive SA

Dhinesh Pandiyan M [Syncfusion]
Replied On February 1, 2010 09:35 AM

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.

http://www.syncfusion.com/uploads/redirect.aspx?file=TextWrapResizing_71b05bde.zip&team=development

Let us know if you have any other questions.

With Regards,
Dhinesh Pandiyan

paul
Replied On October 1, 2010 05:02 PM

Hello,

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 05:11 AM

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]
http://www.syncfusion.com/uploads/redirect.aspx?file=RichTextBox_7327c279.zip&team=development


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.

Regards,
Jeraldes J



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.

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.

;