Back to Devexpress

ASPxGridColumnDataEventArgs.GetListSourceFieldValue(String) Method

aspnet-devexpress-dot-web-dot-aspxgridcolumndataeventargs-dot-getlistsourcefieldvalue-x28-system-dot-string-x29.md

latest3.1 KB
Original Source

ASPxGridColumnDataEventArgs.GetListSourceFieldValue(String) Method

Returns the value of the specified cell in the processed data item (row, card or record) in the control’s underlying data source.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
public object GetListSourceFieldValue(
    string fieldName
)
vb
Public Function GetListSourceFieldValue(
    fieldName As String
) As Object

Parameters

NameTypeDescription
fieldNameString

A string that specifies the required field name.

|

Returns

TypeDescription
Object

An object that is a value from the control’s data source.

|

Remarks

The GetListSourceFieldValue method returns a value from the specified field in the processed data item in the control’s underlying data source. To get values in other rows, use the GetListSourceFieldValue method’s overload.

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

asp-net-web-forms-grid-set-edit-form-values/CS/Solution/ClientSide.aspx.cs#L10

csharp
if (e.Column.FieldName == "Total") {
    decimal price = (decimal)e.GetListSourceFieldValue("UnitPrice");
    int quantity = Convert.ToInt32(e.GetListSourceFieldValue("UnitsInStock"));

asp-net-web-forms-grid-set-edit-form-values/VB/Solution/ClientSide.aspx.vb#L13

vb
If Equals(e.Column.FieldName, "Total") Then
    Dim price As Decimal = CDec(e.GetListSourceFieldValue("UnitPrice"))
    Dim quantity As Integer = Convert.ToInt32(e.GetListSourceFieldValue("UnitsInStock"))

See Also

ASPxGridColumnDataEventArgs Class

ASPxGridColumnDataEventArgs Members

DevExpress.Web Namespace