Version

Wrapping Text in a Header

This functionality automatically wraps the text in a header if horizontal width of the header is not enough to fully display the text. The column header will also automatically adjust its height if the resulting multi-line text does not fit the height.

You can also set this property at design time via the WinGrid™ designer by following the below steps.

  1. Right click on the UltraGrid and select the UltraWinGrid Designer. The designer dialog should come up.

  2. In the designer select the Control Settings in the left pane.

  3. In the right pane expand the UltraGrid.

  4. Expand DisplayLayout .

  5. Select and expand Override .

  6. The property grid on the right now should list all the properties of the Override object. Find WrapHeaderText and set it to True.

  7. For demonstration purposes run the project. Initially it should look something like the following.

wrap text in a header in ultragrid
  1. Resize a column smaller so that it’s caption does not fully fit the horizontal width of the header. You will notice that the header’s height will increase and the header caption will be wrapped. This way the caption will stay fully visible.

wrap text in a header in ultragrid
  1. Resizing the column back to a width that can accommodate the header caption on a single line will cause the height of the header to be adjusted back to a single line height.

wrap text in a column header in ultragrid