I am trying to achieve wrapping and unwrapping of text in C1FlexGrid columns in a menu click event handler. The below code works to wrap the text when appropriate menu action is selected. But how I can unwrap the text?
Me.Styles(C1.Win.C1FlexGrid.CellStyleEnum.Normal).WordWrap = True
Me.AllowResizing = AllowResizingEnum.Rows
Me.AutoSizeRows()
I tried the below code but it did not make any difference. Any help is appreciated. Thank you!
Me.Styles(C1.Win.C1FlexGrid.CellStyleEnum.Normal).WordWrap = False
Me.AllowResizing = AllowResizingEnum.None
Me.AutoResize = False
You will need to loop round all the rows in the grid and set the height to -1. This will set them back to the default height.
You could create an extension method to toggle between auto-sized row heights that will allow the word-wrapping or default height rows.
Then call
grid.AutoSizeRows()
to increase the row height to allow wrapped text andgrid.AutoSizeRows(True)
to reset the rows back to their default height.