Hi,
I have a grid. I want that whenver a user enters data in the cell of the column of the grid, the text wraps up if it exceeds the width of the column. Also multiline is set to true so that the user can enter multiple lines as well. This can be done for any cell of the particular column of the grid.
Is there any option where the text gets wrap up and the height of only that row increases accordingly? Please help me...
Thanks
Hello, I think you can use the fallowing snipped in order to make your grid to wrap up the text in a column and allow the multiline: this.ultraGrid1.DisplayLayout.Bands[0].Columns[1].CellAppearance.TextTrimming = TextTrimming.EllipsisWord; this.ultraGrid1.DisplayLayout.Bands[0].Columns[1].CellMultiLine = DefaultableBoolean.True; this.ultraGrid1.DisplayLayout.Override.RowSizing = RowSizing.AutoFixed;If you wanted to resize each row any time its values were changed, as well as when first populated, you'd want to call " e.Row.PerformAutoSize();" in the InitializeRow event handler.I hope this helps.Sincerely,Dimi GinevaDeveloper Support EngineerInfragistics, Inc.
When I try this, the row only resizes when you tab out of the cell, not whilst editing the cell. Is this what you would expect? This means that if I enter a carriage return, or my text wraps onto the second line, I can't see the rest of my text until I come out of the cell. :-(
Ok, I figured out why this is happening. It's because the cell value is not updated until you exit the editor. I can get around this by copying the cell.Text into the cell.Value in the CellChange event. Unfortunately, because of the difference between rendering of the cell when it is in Edit Mode or not, the cell resizes incorrectly for my editing. I've tried changing TextRenderingMode to GDI, but it is still different when in edit mode or not (i.e. because the text is slightly different, the wrapping occurs at different places in each mode).
I could possibly get away with using AutoSizeEdit on the column, but I have my Override.BorderStyleCell/Row set to None, and the editor comes up with a border if I use this, and I can't find where to turn that off.
Any hep gratefully appreciated.
Hello jcwild, I am not sure that setting the Value while the cell is in edit mode is good idea but if is working for you. You can try to play with the UltraGridAction.ExitEditMode and UltraGridAction.EnterEditMode when the CellChange gets fired and use the new text and after that enter again to edit mode. Or you can try to set the editor to be always in edit mode in combination of TextRenderingMode set to GDI. I hope this help. Sincerely,DimiDeveloper Support EngineerInfragistics, Inc.