windowsforms-devexpress-dot-xtragrid-dot-columns-dot-gridcolumn-23e38b7a.md
Returns the actual display caption for the current column.
Namespace : DevExpress.XtraGrid.Columns
Assembly : DevExpress.XtraGrid.v25.2.dll
NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation
public virtual string GetCaption()
Public Overridable Function GetCaption As String
| Type | Description |
|---|---|
| String |
A string that specifies the column’s actual display caption.
|
If the GridColumn.Caption property is set to an empty string, a friendly display caption is automatically generated according to the GridColumn.FieldName property. Use the GetCaption method to return the actual display caption. To get the actual display caption in Layout Views, use the LayoutView.GetFieldCaption method.
See GridColumn.Caption to learn more.
The following code snippets (auto-collected from DevExpress Examples) contain references to the GetCaption() method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-grid-double-click-row-cell/CS/DoubleClickCell/Form1.cs#L27
if(info.InRow || info.InRowCell) {
string colCaption = info.Column == null ? "N/A" : info.Column.GetCaption();
MessageBox.Show(string.Format("DoubleClick on row: {0}, column: {1}.", info.RowHandle, colCaption));
headerEdit.SetBounds(bounds.X, bounds.Y, bounds.Width, bounds.Height);
headerEdit.EditValue = column.GetCaption();
headerEdit.Show();
winforms-grid-double-click-row-cell/VB/DoubleClickCell/Form1.vb#L28
If info.InRow OrElse info.InRowCell Then
Dim colCaption As String = If(info.Column Is Nothing, "N/A", info.Column.GetCaption())
MessageBox.Show(String.Format("DoubleClick on row: {0}, column: {1}.", info.RowHandle, colCaption))
headerEdit.SetBounds(bounds.X, bounds.Y, bounds.Width, bounds.Height)
headerEdit.EditValue = column.GetCaption()
headerEdit.Show()
See Also