Back to Devexpress

ASPxGridView.CustomPreviewDisplayText Event

aspnet-devexpress-dot-web-dot-aspxgridview-40eff5a2.md

latest3.3 KB
Original Source

ASPxGridView.CustomPreviewDisplayText Event

Enables you to provide custom display text for a preview row.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public event ASPxGridViewPreviewDisplayTextEventHandler CustomPreviewDisplayText
vb
Public Event CustomPreviewDisplayText As ASPxGridViewPreviewDisplayTextEventHandler

Event Data

The CustomPreviewDisplayText event's data class is ASPxGridViewPreviewDisplayTextEventArgs. The following properties provide information specific to this event:

PropertyDescription
DisplayTextEnables you to set a custom text for the preview row currently being processed.
EncodeHtmlGets or sets a value that specifies whether the preview row display text keeps any of its values that are HTML as HTML, or instead, strips out the HTML markers.
ValueGets the value of the preview row currently being processed.
VisibleIndexGets the visible index of the preview row currently being processed.

The event data class exposes the following methods:

MethodDescription
GetRowValue(Int32, String)Returns the value of the specified data source field in the specified row.
GetRowValue(String)Returns the value of the specified data source field in the current row.

Remarks

The CustomPreviewDisplayText event can be used to provide custom display text for a preview row. The text provided by this event will be used when the ASPxGridView is printed or exported.

Initially, the ASPxGridViewPreviewDisplayTextEventArgs.DisplayText parameter returns null. To provide custom display text, assign the required string to this parameter. To get the current cell value, use the ASPxGridViewPreviewDisplayTextEventArgs.Value parameter.

See Also

ASPxGridView Class

ASPxGridView Members

DevExpress.Web Namespace