I have a textbox with multiline = true and
wrap = true with maxSize = 2000
Now this data is being saved into a cell of a datagrid
I need to adjust the height and width of the cell(of datagrid) accordingly
Can Some One Help me
ADAdministrator Syncfusion Team August 9, 2004 03:24 PM UTC
To programatically size the row heights and colwidth, you call grid.Model.RowHeights.ResizeToFit and grid.Model.ColWidths.ResizeToFit. (If you are trying to do this from a point when the grid is not visibl, say in FormLoad, you should also set grid.AllowResizeToFit = false.)
SHShriAugust 9, 2004 04:37 PM UTC
can i set minimum column size(width) so that when it auto resizes the column it doesnt go down certain value
ADAdministrator Syncfusion Team August 9, 2004 05:31 PM UTC
There is a GridResizeToFitOption.NoShrink flag you can pass when you call grid.Model.ColWidths.ResizeToFit to prevent the size from decreasing, but I do not think this is what you asked about when you mentioned mimum size.
To impose a Minimum size, you would have to first call grid.Model.ResizeToFit and then have code like:
Me.Grid.Model.ColWidths = Math.Max(Me.Grid.Model.ColWidths, someMinValue)
If it flickers too much, you can add a grid.BeginUpdate before you do teh resizing, and a grid.EndUpdate followed by grid.Refresh after the sizing code.
SHShriAugust 9, 2004 07:08 PM UTC
its working fine except the wrap property
ie., if the user has not used the "Enter" key during input into the textbox....
and if the input is one long line
then it should wrap itself at the max length of the cell and appear in the next line
i tried other ways too but this is not working
ADAdministrator Syncfusion Team August 9, 2004 08:58 PM UTC
If you drag the row height larger, you should be able to see the multiple lines if you have style.WrapText = true.
If you want to have the cell height autosize as you type into the cell, then try setting the style.AutoSize = true for that column.
ADAdministrator Syncfusion Team August 10, 2004 11:35 AM UTC