I have a multiline column with multiline texts in it, but when I click the cell(CellClickAction is Edit), the text in the cell become singleline.
how do I keep the texts in multiline even the cells are in Edit mode? Is there anything with celldisplaystyle and style property of the column I can treat with to do so?
Hello.
If I am reading this correctly, the grid renders the cell with text that is wrapped and the row grows a little taller to accomodate the text. When you click the cell to go into edit mode, it reverts back to single line editing. Is this correct?
In order to have the grid show wrapped text in the cells, you have to allow it to re-size the rows. You do that by setting the RowSizing property on DisplayLayout.Override:
ultraGrid1.DisplayLayout.Override.RowSizing = RowSizing.AutoFree;
As long as it is not RowSizing.Fixed, then the grid will be able to expand the height of the row to make it wrap the text. Once this happens, if you set Coumn.CellMultiLine to true, then putting the cell into edit mode will allow you to enter text in a multi-line format.
What are the exact properties that you have set?
thank you, Charlie
but it seems no matter what properties i set the lines still become singleline when in editmode.
finally i found it was the text in the cell that cause all this.
if the lines are split with \n, they will become single-lined in edit mode but looks fine not in edit mode
if the lines are split with \r\n, they will remain multilined either in edit mode or not
Setting the Column.CellMultiLine and Column.AutoSizeEdit properties should make it wrap. I have attached a sample application here for you to run to see what I mean. The column with the caption "Text" contains text that wraps and it will wrapw hile in edit mode.
I also added some code in the AfterExitEditMode event which will expand the row to the new height once editing is finished, so that is a little extra bonus. It's not directly related to what you are looking for, but I was using this sample to demonstrate this same cell multi line wrapping functionality to someone else and they wanted this feature.
Please let me know if you need anything else.
Charlie