DataGridViewColumn.ToolTipText Property

Definition

Gets or sets the text used for ToolTips.

public string ToolTipText { get; set; }

Property Value

The text to display as a ToolTip for the column.

Examples

The following code example shows how to set a column's ToolTip. This code example is part of a larger code example provided for the DataGridViewColumn class.

private void ToolTips()
{
    DataGridViewColumn firstColumn = dataGridView.Columns[0];
    DataGridViewColumn thirdColumn = dataGridView.Columns[2];
    firstColumn.ToolTipText =
        "This column uses a default cell.";
    thirdColumn.ToolTipText =
        "This column uses a template cell." +
        " Style changes to one cell apply to all cells.";
}

Remarks

The column's ToolTip displays when the mouse pointer rests on the column header.

Applies to

Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also