Back to Devexpress

GridColumn.ToString() Method

windowsforms-devexpress-dot-xtragrid-dot-columns-dot-gridcolumn-182614fc.md

latest3.7 KB
Original Source

GridColumn.ToString() Method

Gets the column’s caption.

Namespace : DevExpress.XtraGrid.Columns

Assembly : DevExpress.XtraGrid.v25.2.dll

NuGet Packages : DevExpress.Win.Grid, DevExpress.Win.Navigation

Declaration

csharp
public override string ToString()
vb
Public Overrides Function ToString As String

Returns

TypeDescription
String

A string that specifies the column’s caption.

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the ToString() 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-forcibly-show-cell-tooltips/CS/AlwaysShowCellHints/Form1.cs#L26

csharp
string text = view.GetRowCellDisplayText(info.RowHandle, info.Column);
string cellKey = info.RowHandle.ToString() + " - " + info.Column.ToString();
e.Info = new ToolTipControlInfo(cellKey, text);

winforms-grid-hide-vertical-lines-between-certain-columns/CS/E3647/Form1.cs#L72

csharp
foreach (GridColumn column in gridView1.Columns)
    checkedListBoxControl1.Items.Add(column, column.ToString(), CheckState.Unchecked, true);
checkedListBoxControl1.Items[0].CheckState = CheckState.Checked;

winforms-grid-forcibly-show-cell-tooltips/VB/AlwaysShowCellHints/Form1.vb#L29

vb
Dim text_Renamed As String = view.GetRowCellDisplayText(info.RowHandle, info.Column)
Dim cellKey As String = info.RowHandle.ToString() & " - " & info.Column.ToString()
e.Info = New ToolTipControlInfo(cellKey, text_Renamed)

winforms-grid-hide-vertical-lines-between-certain-columns/VB/E3647/Form1.vb#L69

vb
For Each column As GridColumn In gridView1.Columns
    checkedListBoxControl1.Items.Add(column, column.ToString(), CheckState.Unchecked, True)
Next column

See Also

Caption

GetCaption()

GetTextCaption()

GridColumn Class

GridColumn Members

DevExpress.XtraGrid.Columns Namespace