Export (0) Print
Expand All

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, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

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

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Community Additions

ADD
Show:
© 2014 Microsoft