Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxTreeList.GetRowValue(Int32, String) Method

Returns the value of the data source field in the specified row.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public object GetRowValue(
    int visibleIndex,
    string fieldName
)

#Parameters

Name Type Description
visibleIndex Int32

The row’s visible index.

fieldName String

The name of the data source field.

#Returns

Type Description
Object

The data object contained within the specified data source field.

#Remarks

Note

When the TreeList is bound to the GridDevExtremeDataSource or loads data on demand, call the WaitForRemoteSourceRowLoadAsync(Int32) method before you execute the GetRowValue method to ensure that the specified data row is loaded.

The following example displays information about the first visible row:

@inject EmployeeTaskService EmployeeTaskService

<style>
    .my-button {
        width: 200px;
    }
</style>

<DxTreeList @ref="@MyTreeList" Data="TreeListData" KeyFieldName="Id" ParentKeyFieldName="ParentId">
    <Columns>
        <DxTreeListDataColumn FieldName="Name" Caption="Task" />
        <DxTreeListDataColumn FieldName="EmployeeName" />
        <DxTreeListDataColumn FieldName="StartDate" />
        <DxTreeListDataColumn FieldName="DueDate" />
    </Columns>
</DxTreeList>
<DxButton Click="@OnClick" CssClass="my-button" Text="Get the First Task" />
<p></p>
Task Name: @RowValue

@code {
    ITreeList MyTreeList { get; set; }
    object RowValue { get; set; }
    List<EmployeeTask> TreeListData { get; set; }

    protected override void OnInitialized() {
        TreeListData = EmployeeTaskService.GenerateData();
    }
    void OnClick() {
        RowValue = MyTreeList.GetRowValue(0, "Name");
    }
}

DevExpress Blazor TreeList - Get Row Value

See Also