Back to Devexpress

GridColumnDataEventArgs.GetListSourceFieldValue(String) Method

wpf-devexpress-dot-xpf-dot-grid-dot-gridcolumndataeventargs-dot-getlistsourcefieldvalue-x28-system-dot-string-x29.md

latest3.3 KB
Original Source

GridColumnDataEventArgs.GetListSourceFieldValue(String) Method

Returns the value of the specified cell within the processed row in the grid’s data source.

Namespace : DevExpress.Xpf.Grid

Assembly : DevExpress.Xpf.Grid.v25.2.dll

NuGet Package : DevExpress.Wpf.Grid.Core

Declaration

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

Parameters

NameTypeDescription
fieldNameString

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

|

Returns

TypeDescription
Object

An object that represents a value from the grid’s data source.

|

Remarks

This method allows you to obtain any field value from the data source record to which the processed row corresponds. To obtain any field value in any data source record, 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.

wpf-data-grid-create-unbound-columns/CS/DXGrid_UnboundColumns_CodeBehind/Window1.xaml.cs#L13

csharp
if(e.IsGetData) {
    int price = Convert.ToInt32(e.GetListSourceFieldValue(nameof(Product.UnitPrice)));
    int quantity = Convert.ToInt32(e.GetListSourceFieldValue(nameof(Product.Quantity)));

wpf-data-grid-create-unbound-columns/VB/DXGrid_UnboundColumns_CodeBehind/Window1.xaml.vb#L17

vb
If e.IsGetData Then
    Dim price As Integer = Convert.ToInt32(e.GetListSourceFieldValue(NameOf(Product.UnitPrice)))
    Dim quantity As Integer = Convert.ToInt32(e.GetListSourceFieldValue(NameOf(Product.Quantity)))

See Also

GridColumnDataEventArgs Class

GridColumnDataEventArgs Members

DevExpress.Xpf.Grid Namespace