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 */
public int get_DividerHeight ()

/** @property */
public void set_DividerHeight (int value)

public function get DividerHeight () : int

public function set DividerHeight (value : int)

Not applicable.

Property Value

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

Exception typeCondition

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

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2014 Microsoft