hello, I'm trying to put vbcrlf in a cell and then autoresize that row so that the cell can display a few data items. I.e. I have the column bound to a string and the contents of the string is:
"7/1/2008" & vbCrLf & "7/2/2008" & vbCrLf & "7/3/2008"
I want it to show up in the cell as (but w/o the bulleted list look):
Thanks
Rocky
As a followup to this question... if I use the following code after binding the grid:
This will make it so my cell displays the first date (stops displaying at the first vbCrLf it encounters, but if I mouseover the field, the caption that appears DOES correctly display the 3 dates, even though the 2nd and 3rd don't show up in the field. The 3 dates are also shown in the caption on separate lines, as I need.
Any ideas?
Hi Rocky,
Setting CellDisplayStyle is not what you want. That setting allows you to do formatting in the cell like colors and such, it has nothing to do with the kind of mulitline you are looking at here.
You probably just need to set CellMultiline to true on the column. You may also want to check out RowSizing, AllowColSizing, and the PerformAutoResize method on the row and the column.
Perfect, that got me what I needed. In case anyone else is interested, here is the code I'm using to resize all the rows and columns and allow multiline cells:
dgOfferings.DisplayLayout.Override.RowSizing = UltraWinGrid.RowSizing.AutoFree For Each ugr1 As Infragistics.Win.UltraWinGrid.UltraGridRow In dgOfferings.Rows For Each ugr2 As Infragistics.Win.UltraWinGrid.UltraGridRow In ugr1.ChildBands(0).Rows ugr2.Cells("CombinedDatesTimes").Column.CellDisplayStyle = UltraWinGrid.CellDisplayStyle.FormattedText ugr2.Cells("CombinedDatesTimes").Column.CellMultiLine = DefaultableBoolean.True For Each cell As Infragistics.Win.UltraWinGrid.UltraGridCell In ugr2.Cells cell.Column.PerformAutoResize(UltraWinGrid.PerformAutoSizeType.AllRowsInBand, True) Next ugr2.PerformAutoSize() Next Next
There may be a better way but this is working perfectly so I'm moving on.
Thanks again,
See RowSizing property off the override for more info. Essentially you need to set the grid.DisplayLayout.Override.RowSizing property to AutoFree or AutoFixed.
Sandip
Thanks for the reply. That got me partially where I need to be... using CellMultiline on the column property, I have bene able to get it to show the multiple dates in the field. However, doing PerformAutoResize() on the row doesn't make it show the data like I had hoped. It doesn't do anything, actually. I added code to manually set the height of the row depending on the # of dates in the date cell for each row, but I noticed another issue. Do all the rows have to have the same height? I haven't been able to find a property to set that makes this not true and as it currently stands, all the rows will have the height of the last row height that I set.