Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
DividerHeight Property

DataGridViewRow.DividerHeight Property

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

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public int DividerHeight { get; set; }

Property Value

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

ExceptionCondition
InvalidOperationException

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

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.

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

// 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;
}

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft