GrapeCity MultiRow Windows Forms Documentation
RowHeaderCell Constructor
Example 


Initializes a new instance of the RowHeaderCell class.
Syntax
Public Function New()
Dim instance As New RowHeaderCell()
public RowHeaderCell()
Remarks

This constructor initializes the Cell.ResizeMode property value to ResizeMode.Vertical.

This constructor initializes the SelectionMode property value to MultiRowSelectionMode.Row.

This constructor initializes the HoverDirection property value to HoverDirection.Right.

Example
The following code example shows how to add a RowHeaderCell and some TextBoxCells to the Row.Cells. This code example is part of a larger example provided for the HeaderCell class.
private Cell[] CreateCellsInRow()
        {
            RowHeaderCell rowHeaderCell1 = new RowHeaderCell();
            rowHeaderCell1.Size = new Size(36, 21);
            rowHeaderCell1.ValueFormat = "1";
            //The cell's bottom draws a gutter.
            rowHeaderCell1.GutterStyles = GutterStyles.Bottom;
            //The cell's right draws the hover effect.
            rowHeaderCell1.HoverDirection = HoverDirection.Right;

            //Use the CellStyle.BackColor to draw the HeaderCell's background, do not use the VistualStyle 
backcolor.
            rowHeaderCell1.FlatStyle = FlatStyle.Standard;
            rowHeaderCell1.UseVisualStyleBackColor = false;
            rowHeaderCell1.Style.BackColor = Color.DarkGoldenrod;
            rowHeaderCell1.Style.SelectionBackColor = Color.LightBlue;

            TextBoxCell textBoxCell1 = new TextBoxCell();
            textBoxCell1.Size = new Size(80, 21);
            textBoxCell1.Location = new Point(rowHeaderCell1.Left + rowHeaderCell1.Width, 0);

            TextBoxCell textBoxCell2 = textBoxCell1.Clone() as TextBoxCell;
            textBoxCell2.Location = new Point(textBoxCell1.Left + textBoxCell1.Width, 0);

            Cell[] cells = new Cell[] { rowHeaderCell1, textBoxCell1, textBoxCell2 };

            return cells;
        }
Private Function CreateCellsInRow() As Cell()
        Dim rowHeaderCell1 As New RowHeaderCell()
        rowHeaderCell1.Size = New Size(36, 21)
        rowHeaderCell1.ValueFormat = "1"
        'The cell's bottom draws a gutter.
        rowHeaderCell1.GutterStyles = GutterStyles.Bottom
        'The cell's right draws a hover effect.
        rowHeaderCell1.HoverDirection = HoverDirection.Right

        'Use the CellStyle.BackColor to draw the HeaderCell's background, do not use the VisualStyle backcolor.
        rowHeaderCell1.FlatStyle = FlatStyle.Standard
        rowHeaderCell1.UseVisualStyleBackColor = False
        rowHeaderCell1.Style.BackColor = Color.DarkGoldenrod
        rowHeaderCell1.Style.SelectionBackColor = Color.LightBlue

        Dim textBoxCell1 As New TextBoxCell()
        textBoxCell1.Size = New Size(80, 21)
        textBoxCell1.Location = New Point(rowHeaderCell1.Left + rowHeaderCell1.Width, 0)

        Dim textBoxCell2 As TextBoxCell = TryCast(textBoxCell1.Clone(), TextBoxCell)
        textBoxCell2.Location = New Point(textBoxCell1.Left + textBoxCell1.Width, 0)

        Dim cells As Cell() = New Cell() {rowHeaderCell1, textBoxCell1, textBoxCell2}

        Return cells
    End Function
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

RowHeaderCell Class
RowHeaderCell Members

 

 


Copyright © GrapeCity, inc. All rights reserved.