Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

DataGridView.TopLeftHeaderCell Property

Note: This property is new in the .NET Framework version 2.0.

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)

public DataGridViewHeaderCell TopLeftHeaderCell { get; set; }
/** @property */
public DataGridViewHeaderCell get_TopLeftHeaderCell ()

/** @property */
public void set_TopLeftHeaderCell (DataGridViewHeaderCell value)

public function get TopLeftHeaderCell () : DataGridViewHeaderCell

public function set TopLeftHeaderCell (value : DataGridViewHeaderCell)

Property Value

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.

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

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

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

.NET Framework

Supported in: 2.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.