DataGridViewRow.DividerHeight Property

Definition

Gets or sets the height, in pixels, of the row divider.

public:
 property int DividerHeight { int get(); void set(int value); };
public int DividerHeight { get; set; }
member this.DividerHeight : int with get, set
Public Property DividerHeight As Integer

Property Value

The height, in pixels, of the divider (the row's bottom margin).

Exceptions

When setting this property, the row is in a DataGridView control and is a shared row.

Examples

The following code example modifies the height of a row's divider to provide emphasis.

// Set a thick horizontal edge.
void Button7_Click( Object^ /*sender*/, System::EventArgs^ /*e*/ )
{
   int secondRow = 1;
   int edgeThickness = 3;
   DataGridViewRow^ row = dataGridView->Rows[ secondRow ];
   row->DividerHeight = 10;
}


// Set a thick horizontal edge.
private void Button7_Click(object sender,
    System.EventArgs e)
{
    int secondRow = 1;
    DataGridViewRow row = dataGridView.Rows[secondRow];
    row.DividerHeight = 10;
}
' Set a thick horizontal edge.
Private Sub Button7_Click(ByVal sender As Object, _
    ByVal e As System.EventArgs) Handles Button7.Click

    Dim secondRow As Integer = 1
    Dim row As DataGridViewRow = dataGridView.Rows(secondRow)
    row.DividerHeight = 10

End Sub

Remarks

This property is useful to provide a visual boundary between frozen rows and rows that can scroll. The extra edge is part of the current row, although it will take on the foreground color of the associated DataGridView. The extra edge does not extend the area in which users can double-click to automatically resize a row. To resize a row, the user must double-click on the boundary between the divider and the adjacent row.

Applies to

See also