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

Wrap text in cell for a specific column

I need to wrap the text in one column in a databound grid. how do you do this? Thanks in advance

8 Replies

AD Administrator Syncfusion Team December 12, 2002 01:21 PM

> I need to wrap the text in one column in a databound grid. how do you do this? > > Thanks in advance You can set .WrapText = true for the GridBoundColumn.StyleInfo of the GridBoundColumn for the column. Stefan


AS Adi Saric February 17, 2003 01:00 PM

> > I need to wrap the text in one column in a databound grid. how do you do this? > > > > Thanks in advance > > You can set .WrapText = true for the GridBoundColumn.StyleInfo of the GridBoundColumn for the column. > > Stefan I have tried this and the text still does not wrap. At least the row height does not increase by itself. Is there a known issue with this function? I can attach/email code if necessary.


AD Administrator Syncfusion Team February 17, 2003 03:22 PM

> I have tried this and the text still does not wrap. At least the row height does not increase by itself. Is there a known issue with this function? I can attach/email code if necessary. > To automatically increase row heights while the user enters text you need to set .AutoSize = true. Call Model.Rows.ResizeToFit to resize rows to fit cell contents from code. Stefan


AD Administrator Syncfusion Team February 17, 2003 03:26 PM

If you want the cell to grow and wrap text as you type into the cell, there are 3 things that you need to do. The first 2 are to set both the WrapText and AutoSize properties for the column's styleinfo. The last requirement is due to a problem that we will have to correct. Right now, if the initial row height is set at the default, then the TextBox in the cell is set as a single line text, and not a multiline textbox. So currently, you need to set the default row height to be larger that its original default. Here is code that worked for me just dropping a GridDataBoundGrid onto a form. this.gridDataBoundGrid1.DefaultRowHeight += 6;


AS Adi Saric February 17, 2003 03:46 PM

Thanks Clay but this did not work either. I have a hierarchy grid inside the main grid for whose column I am trying to set wrapping for. I set the default row height of the main grid to +6 and the autosize and wraptext to true for the gridboundcolumn of my second level hierarchy grid. This does increase the height of all rows by 6 pixels but it still cuts off the text in my column. I also want the row height growth to happen only for the cells that exceed it with the text length. Also my column celltype is static and not a textbox. Adi


AD Administrator Syncfusion Team February 17, 2003 05:05 PM

Can you post a sample porject showing what you are trying to do?


AS Adi Saric February 19, 2003 04:55 PM

Can I email you the code instead of posting?


AD Administrator Syncfusion Team February 19, 2003 06:11 PM

You can open a Direct Trac support incident and attach the files to it. http://www.syncfusion.com/support/logon.asp?URL=/support/default.asp

Loader.
Live Chat Icon For mobile
Up arrow icon