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

    To set multiple height values for rows, set the AllowRowSizing property to IndividualRows then assign height values to rows.

    Complete the following steps:

    1. Set the AllowRowSizing property to IndividualRows.

      In the Designer

      Locate the AllowRowSizing property in the Properties window and set it to IndividualRows.


      In Code

      Add the following code to the Form_Load event:

      To write code in Visual Basic

      Visual Basic
      Copy Code
      Me.C1TrueDBGrid1.AllowRowSizing = C1.Win.C1TrueDBGrid.RowSizingEnum.IndividualRows
      

      To write code in C#

      C#
      Copy Code
      this.c1TrueDBGrid1.AllowRowSizing = C1.Win.C1TrueDBGrid.RowSizing.IndividualRows;
      
    2. Assign different row heights to the first 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).Rows(0).Height = 25
      Me.C1TrueDBGrid1.Splits(0).Rows(1).Height = 50
      

      To write code in C#

      C#
      Copy Code
      this.c1TrueDBGrid1.Splits[0].Rows[0].Height = 25;
      this.c1TrueDBGrid1.Splits[0].Rows[1].Height = 50;
      

    What You've Accomplished

    The first row is set to 25 and the second row is set to 50: