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

TreeListFocusedRowChangedEventArgs Class

Contains data for the FocusedRowChanged event.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public class TreeListFocusedRowChangedEventArgs :
    GridFocusedRowChangedEventArgsBase

#Remarks

The FocusedRowChanged event allows you to handle focused row changes. The TreeListFocusedRowChangedEventArgs object contains data related to the event.

In the following code snippet, the TreeList component displays additional information about the focused space object:

@inject SpaceObjectDataProvider SpaceObjectDataProvider

<DxTreeList Data="TreeListData"
            ChildrenFieldName="Satellites"
            FocusedRowEnabled="true"
            FocusedRowChanged="TreeList_FocusedRowChanged">
    <Columns>
        <DxTreeListDataColumn FieldName="Name" />
        <DxTreeListDataColumn FieldName="TypeOfObject" Caption="Type" />
        <DxTreeListDataColumn FieldName="Mass10pow21kg" Caption="Mass, kg" DisplayFormat="N2">
            <HeaderCaptionTemplate>Mass, 10<sup>21</sup> &#215; kg</HeaderCaptionTemplate>
        </DxTreeListDataColumn>
        <DxTreeListDataColumn FieldName="MeanRadiusInKM" Caption="Radius, km" DisplayFormat="N2" />
        <DxTreeListDataColumn FieldName="Volume10pow9KM3" DisplayFormat="N2">
            <HeaderCaptionTemplate>Volume, 10<sup>9</sup> &#215; km<sup>3</sup></HeaderCaptionTemplate>
        </DxTreeListDataColumn>
        <DxTreeListDataColumn FieldName="SurfaceGravity" DisplayFormat="N2">
            <HeaderCaptionTemplate>Gravity, m/s<sup>2</sup></HeaderCaptionTemplate>
        </DxTreeListDataColumn>
    </Columns>
</DxTreeList>

@if (FocusedSpaceObject != null) {
    <h5>@FocusedSpaceObject.Name</h5>
    <ul>
        <li><b>Radius</b>: @FocusedSpaceObject.MeanRadiusInKM.ToString("N2") km</li>
        <li><b>Density</b>: @FocusedSpaceObject.Density.ToString("N2") g/cm<sup>3</sup></li>
        <li><b>Gravity</b>: @FocusedSpaceObject.SurfaceGravity.ToString("N2") m/s<sup>2</sup></li>
    </ul>
}

@code {
    object TreeListData { get; set; }
    SpaceObject FocusedSpaceObject { get; set; }

    protected override async Task OnInitializedAsync() {
        TreeListData = SpaceObjectDataProvider.GenerateData();
    }
    void TreeList_FocusedRowChanged(TreeListFocusedRowChangedEventArgs e) {
        FocusedSpaceObject = e.DataItem as SpaceObject;
    }
}

TreeList Focused Row

Run Demo: TreeList - Focused Row

#Inheritance

Object
DevExpress.Blazor.Internal.GridEventArgsBase
DevExpress.Blazor.Internal.GridFocusedRowChangedEventArgsBase
TreeListFocusedRowChangedEventArgs
See Also