Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DataGridView.TopLeftHeaderCell Property

Gets or sets the header cell located in the upper left corner of the DataGridView control.

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

[BrowsableAttribute(false)]
public DataGridViewHeaderCell TopLeftHeaderCell { get; set; }

Property Value

Type: System.Windows.Forms.DataGridViewHeaderCell
The DataGridViewHeaderCell located at the upper left corner of the DataGridView.

Setting this property allows you to set a value for the cell, associate a shortcut menu with it, or perform any other operations you can perform on a DataGridViewHeaderCell.

In applications designed for use with right-to-left languages, the cell represented by this property is typically in the upper-right corner.

The following code example uses this property to display a value in the upper-left corner of a DataGridView control. This value labels a child table in a master/detail scenario. This example is part of a larger example available in the DataGridViewComboBoxColumn class overview topic.

private void SetUpDataGridView2()
{
    DataGridView2.Dock = DockStyle.Bottom;
    DataGridView2.TopLeftHeaderCell.Value = "Sales Details";
    DataGridView2.RowHeadersWidthSizeMode = 
        DataGridViewRowHeadersWidthSizeMode.AutoSizeToAllHeaders;
}

.NET Framework

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

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Show:
© 2014 Microsoft