Skip to main content
A newer version of this page is available. .
Tab

ASPxGridColumnDisplayTextEventArgs.GetFieldValue(Int32, String) Method

Returns the value of the specified data source field in the specified data item (row, card or record).

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v19.1.dll

Declaration

public object GetFieldValue(
    int visibleIndex,
    string fieldName
)

Parameters

Name Type Description
visibleIndex Int32

A zero-based integer index that identifies the data item (row, card or record).

fieldName String

A String value that specifies the name of the data source field.

Returns

Type Description
Object

An object that is the value of the specified data source field.

Remarks

Find control-specific information (for ASPxGridView, ASPxCardView or ASPxVerticalGrid) in the sections below.

ASPxGridView

When a grid is filtered or sorted by display text (the GridDataColumnSettings.FilterMode or the ASPxGridBehaviorSettings.SortMode property is set to DisplayText), it forces the ASPxGridView.CustomColumnDisplayText event to fire. Since visible row indexes are not defined while filtering or sorting, you cannot use the current overload of the ASPxGridColumnDisplayTextEventArgs.GetFieldValue method to get a value of the non-processed row.

To determine that the event was initiated by filtering or sorting, use the ASPxGridColumnDisplayTextEventArgs.VisibleIndex property, which in this case, returns negative one (-1).

Grid View - Getting Started

ASPxCardView

When a grid is filtered or sorted by display text (the GridDataColumnSettings.FilterMode or the ASPxGridBehaviorSettings.SortMode property is set to DisplayText), it forces the ASPxCardView.CustomColumnDisplayText event to fire. Since visible card indexes are not defined while filtering or sorting, you cannot use the current overload of the ASPxGridColumnDisplayTextEventArgs.GetFieldValue method to get a value of the non-processed card.

To determine that the event was initiated by filtering or sorting, use the ASPxGridColumnDisplayTextEventArgs.VisibleIndex property, which in this case, returns negative one (-1).

Card View - Getting Started

ASPxVerticalGrid

When a grid is filtered or sorted by display text (the GridDataColumnSettings.FilterMode or the ASPxGridBehaviorSettings.SortMode property is set to DisplayText), it forces the ASPxVerticalGrid.CustomRowDisplayText event to fire. Since visible records are not defined while filtering or sorting, you cannot use the current overload of the ASPxGridColumnDisplayTextEventArgs.GetFieldValue method to get a value of the non-processed record.

To determine that the event was initiated by filtering or sorting, use the ASPxGridColumnDisplayTextEventArgs.VisibleIndex property, which in this case, returns negative one (-1).

Vertical Grid - Getting Started

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the GetFieldValue(Int32, String) 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.

See Also