ComponentOne True DBGrid for WinForms
True DBGrid for WinForms Task-Based Help / Setting the Grid's Appearance / Setting the Column's Caption Height
In This Topic
    Setting the Column's Caption Height
    In This Topic

    To set the column's caption height, set the ColumnCaptionHeight property. This can be set either in the designer or in code.

    In the Designer

    To set the column's caption height in the Designer, complete the following steps:

    1. Open the C1TrueDBGrid Designer. For information on how to access the C1TrueDBGrid Designer, see Accessing the C1TrueDBGrid Designer.
    2. Click the Split tab in the left pane.
    3. Locate the ColumnCaptionHeight property and set it to 34.
    4. Click the Column tab.
    5. Locate the Caption property and change it from First to "Composer's First Name".
    6. Click OK to close the C1TrueDBGrid Designer.

    In Code

    To set the column's caption height in code, complete the following steps:

    1. Set the ColumnCaptionHeight property to fit two rows by adding the following code to the Form_Load event:

      To write code in Visual Basic

      Visual Basic
      Copy Code
      Me.C1TrueDBGrid1.Splits(0).ColumnCaptionHeight = Me.C1TrueDBGrid1.Splits(0).ColumnCaptionHeight * 2
      

      To write code in C#

      C#
      Copy Code
      this.c1TrueDBGrid1.Splits[0].ColumnCaptionHeight = this.c1TrueDBGrid1.Splits[0].ColumnCaptionHeight * 2;
      
    2. Set the Caption property:

      To write code in Visual Basic

      Visual Basic
      Copy Code
      Me.C1TrueDBGrid1.Columns(0).Caption = "Composer's First Name"
      

      To write code in C#

      C#
      Copy Code
      this.c1TrueDBGrid1.Columns[0].Caption = "Composer's First Name";
      

    What You've Accomplished

    The caption in the column containing first names is set to Composer's First Name and spans two rows: