FlexGrid for WinForms
Word Wrapping in a Header or Fixed Row
Show AllShow All
Hide AllHide All

To set word wrapping in a header or fixed row, set the Height and WordWrap properties.

  1. Set the Caption property for a column header in the grid.

    In the Designer

    • Select a column in the grid. This will open the Column Tasks menu for that column.
    • In the Column Caption box, enter Word Wrapping in Header.

    Alternatively, the Caption property can also be set using the C1FlexGrid Column Editor.

    • Open the C1FlexGrid Column Editor. For details on how to access the C1FlexGrid Column Editor, see Accessing the C1FlexGrid Column Editor.
    • Select a column in the right pane and set the Caption property in the left pane to Word Wrapping in Header.
    • Click OK to close the editor.

    In Code

    Add the following code to the Form_Load event.

    To write code in Visual Basic

    To write code in C#

  2. Set the row height of the header.

    To write code in Visual Basic

    To write code in C#

  3. Enable word wrapping for the fixed cells.

    In the Designer

    • Open the C1FlexGrid Style Editor. For details on how to access the C1FlexGrid Style Editor, see Accessing the C1FlexGrid Style Editor.
    • Select Fixed in the Built-In Styles list.
    • Locate the WordWrap property in the right pane and set it to True.
    • Click OK to close the designer.

    In Code

    Add the following code to the Form_Load event:

    To write code in Visual Basic

    To write code in C#

This topic illustrates the following:

In this example, a three-line header is created, and the text is wrapped.


 

 


Copyright © GrapeCity, inc. All rights reserved.

Product Support Forum |  Documentation Feedback