Back to Devexpress

ASPxGridColumnDisplayTextEventArgs.DisplayText Property

aspnet-devexpress-dot-web-dot-aspxgridcolumndisplaytexteventargs-64424790.md

latest3.8 KB
Original Source

ASPxGridColumnDisplayTextEventArgs.DisplayText Property

Enables you to set a custom text for the cell currently being processed.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

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

Property Value

TypeDescription
String

A String value that specifies the custom cell’s display text. The default value is null.

|

Remarks

Initially, the DisplayText property returns null. Assign custom text to the DisplayText property to display it in the processed cell.

To get the cell’s edit value, use the ASPxGridColumnDisplayTextEventArgs.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.

asp-net-web-forms-grid-initialize-editor-conditionally/CS/WebApplication_Grid/CustomEditItem.aspx.cs#L42

csharp
case DataType.Dictionary1:
    e.DisplayText = DataProvider.GetDictionaryItem(dataType, Convert.ToInt32(e.Value)).Data;
    break;

asp-net-web-forms-grid-add-numbers-to-rows/CS/Default.aspx.cs#L6

csharp
if (e.Column.Caption == "#") {
    e.DisplayText = e.VisibleRowIndex.ToString();
}

asp-net-web-forms-grid-initialize-editor-conditionally/VB/WebApplication_Grid/CustomEditItem.aspx.vb#L40

vb
Case WebApplication_GridTest.DataType.Dictionary1
    e.DisplayText = DataProvider.GetDictionaryItem(dataType, Convert.ToInt32(e.Value)).Data
Case WebApplication_GridTest.DataType.Dictionary2

asp-net-web-forms-grid-add-numbers-to-rows/VB/Default.aspx.vb#L8

vb
If Equals(e.Column.Caption, "#") Then
    e.DisplayText = e.VisibleRowIndex.ToString()
End If

See Also

GetFieldValue

ASPxGridColumnDisplayTextEventArgs Class

ASPxGridColumnDisplayTextEventArgs Members

DevExpress.Web Namespace