Back to Devexpress

CustomColumnDisplayTextEventArgs.DisplayText Property

windowsforms-devexpress-dot-xtragrid-dot-views-dot-base-dot-customcolumndisplaytexteventargs.md

latest4.7 KB
Original Source

CustomColumnDisplayTextEventArgs.DisplayText Property

Gets or sets the display text for the cell currently being processed.

Namespace : DevExpress.XtraGrid.Views.Base

Assembly : DevExpress.XtraGrid.v25.2.dll

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

Declaration

csharp
public string DisplayText { get; set; }
vb
Public Property DisplayText As String

Property Value

TypeDescription
String

A string representing the cell’s current display text.

|

Remarks

Initially the DisplayText property contains the text currently displayed in the cell. To provide custom text for the cell, assign it to this property.

The cell’s edit value can be obtained via the CustomColumnDisplayTextEventArgs.Value property.

The following code snippets (auto-collected from DevExpress Examples) contain references to the DisplayText property.

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-richedit-highlight-search-results/CS/E4422/Form1.cs#L25

csharp
if (e.Column == colDescription && !string.IsNullOrEmpty(gridView1.FindFilterText)) {
    server.RtfText = e.DisplayText;
    e.DisplayText = server.Text;

winforms-dashboard-custom-items/CS/TutorialsCustomItems/CustomItems/SimpleTableItem.cs#L61

csharp
DashboardFlatDataSource data = (DashboardFlatDataSource)grid.DataSource;
    e.DisplayText = data.GetDisplayText(e.Column.FieldName, e.ListSourceRowIndex);
}

winforms-dashboard-trend-line-indicators/CS/WinformsIndicator/Program.cs#L59

csharp
DashboardFlatDataSource data = (DashboardFlatDataSource)grid.DataSource;
    e.DisplayText = data.GetDisplayText(e.Column.FieldName, e.ListSourceRowIndex);
}

winforms-grid-richedit-highlight-search-results/VB/E4422/Form1.vb#L24

vb
If e.Column Is colDescription AndAlso Not String.IsNullOrEmpty(gridView1.FindFilterText) Then
    server.RtfText = e.DisplayText
    e.DisplayText = server.Text

winforms-dashboard-custom-items/VB/TutorialsCustomItems/CustomItems/SimpleTableItem.vb#L62

vb
Dim data As DashboardFlatDataSource = DirectCast(grid.DataSource, DashboardFlatDataSource)
    e.DisplayText = data.GetDisplayText(e.Column.FieldName, e.ListSourceRowIndex)
End Sub

winforms-dashboard-trend-line-indicators/VB/WinformsIndicator/Program.vb#L67

vb
Dim data As DashboardFlatDataSource = CType(grid.DataSource, DashboardFlatDataSource)
    e.DisplayText = data.GetDisplayText(e.Column.FieldName, e.ListSourceRowIndex)
End Sub

See Also

CustomColumnDisplayTextEventArgs Class

CustomColumnDisplayTextEventArgs Members

DevExpress.XtraGrid.Views.Base Namespace