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

Removing text wrapping....

Hi,

My column header text is very lengthy, it is getting wrapped and get displayed. I don''t want the text to wrap. Instead, I would like to move the column header manually and see the text.
How to remove the text wrapping in my header column.

Please help me out.
Thanks & Regards,
Sathish.

3 Replies

AD Administrator Syncfusion Team August 24, 2006 03:58 AM UTC

Hi Sathish,

Use this code to remove the wrapping in a Column Header cell.

this.grid.BaseStylesMap["Column Header"]. StyleInfo.WrapText = false;

Thanks,
Haneef


SC Sathish Chandran August 24, 2006 10:31 AM UTC

Hi Haneef,

Thanks for your reply. I wan''t to apply this for a row at one shot and also want to know how to apply for a particular cell.

Please help me out.

Thanks & Regards,
Sathish.


AD Administrator Syncfusion Team August 24, 2006 12:00 PM UTC

Hi Sathish,

GridControl :

Please refer to the GridStyleInfoAtWork browser sample for more details.
\Syncfusion\Essential Studio\4.3.0.0\windows\Grid.Windows\Samples\Quick Start\GridStyleInfoAtWork\cs

GridDataBoundGrid:

By default, DataBoundGrid doesn''''t store any style info properties. You can not set any cell or row specific properties for the DataBoundGrid other than the CellValue.You need to handle the PrepareViewStyleInfo (or Model.QueryCellInfo) Event to do this.Through this event you can set the style properties for the grid.

To set the WrapText for a cell, you check for the e.RowIndex/e.ColIndex, if that points to the row you desired, set the e.Style.WrapText for it. Here is some code snippet.

//PrepareViewStyleInfo or Model.QueryCellInfo event
GridCurrentCell cc = this.grid.CurrentCell;
if( e.RowIndex == 2 && e.ColIndex == 2 )
{
e.Style.WrapText = false;
}

For more details, See the below KnowledgeBase Articles:
http://www.syncfusion.com/Support/article.aspx?id=10351
http://www.syncfusion.com/Support/article.aspx?id=560

Please let me know if this helps.
Regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon