Skip to main content
All docs
V25.1
  • TreeListFocusedRowChangedEventArgs Class

    Contains data for the FocusedRowChanged event.

    Namespace: DevExpress.Blazor

    Assembly: DevExpress.Blazor.v25.1.dll

    NuGet Package: DevExpress.Blazor

    Declaration

    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