ADAdministrator 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.
ASAdi SaricFebruary 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.
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.
ADAdministrator 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.
ADAdministrator 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;
ASAdi SaricFebruary 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.
ADAdministrator Syncfusion Team February 17, 2003 05:05 PM
Can you post a sample porject showing what you are trying to do?
ASAdi SaricFebruary 19, 2003 04:55 PM
Can I email you the code instead of posting?
ADAdministrator Syncfusion Team February 19, 2003 06:11 PM
You can open a Direct Trac support incident and attach the files to it.