DataGrid.CaptionText Property


Gets or sets the text of the grid's window caption.

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

public string CaptionText { get; set; }

Property Value

Type: System.String

A string to be displayed as the window caption of the grid. The default is an empty string ("").

The following code example sets the caption of a System.Windows.Forms.DataGrid.

if(dataGrid1.CaptionText == "")
dataGrid1.CaptionText = "Microsoft DataGrid";

.NET Framework
Available since 1.1
Return to top