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.WaitForRemoteSourceRowLoadAsync(Int32) Method

Returns a task that is completed when the specified row of a remote data source is loaded.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public Task WaitForRemoteSourceRowLoadAsync(
    int visibleIndex
)

#Parameters

Name Type Description
visibleIndex Int32

The row’s visible index.

#Returns

Type Description
Task

The task that is completed when the row is loaded.

#Remarks

Call the WaitForRemoteSourceRowLoadAsync method to ensure the specified data row is loaded when the TreeList is bound to the GridDevExtremeDataSource, Custom Data Source, or loads data on demand. For instance, call this method before methods that accept a row’s visible index as a parameter (SelectRow, ExpandRow, and so on).

For multiple rows, use the await Task.WhenAll(…) statement to combine multiple WaitForInstantFeedbackRowLoadAsync method calls.

The following example focuses a row that is outside the visible range:

@inject CitiesService CitiesService

<DxTreeList @ref="MyTreeList"
            Data="@Data"
            FocusedRowEnabled="true"
            KeyFieldName="ID" 
            ParentKeyFieldName="ParentID" 
            HasChildrenFieldName="HasChildren">
    <Columns>
        <DxTreeListDataColumn Caption="Location" FieldName="Name" />
        <DxTreeListDataColumn FieldName="CityType" />
        <DxTreeListDataColumn FieldName="Year" DisplayFormat="d"/>
        <DxTreeListDataColumn FieldName="RecordType" />
        <DxTreeListDataColumn FieldName="Population" />
    </Columns>
</DxTreeList>

<DxButton Click="OnFocusRow">Focus the 100th Row</DxButton>

@code {
    ITreeList MyTreeList { get; set; }
    object Data { get; set; }

    protected override async Task OnInitializedAsync() {
        var cities = await CitiesService.GetCitiesAsync();
        Data = new GridDevExtremeDataSource<Location>(cities.AsQueryable());
    }
    public async Task OnSelectRow() {
        await MyTreeList.WaitForRemoteSourceRowLoadAsync(99);
        MyTreeList.SetFocusedRowIndex(99);
    }
}
See Also