<LumexDataGrid T="User"
               Data="@_users"
               OnRowClick="@OnRowClickHandler">
    <PropertyColumn Property="@(p => p.Name)" />
    <PropertyColumn Property="@(p => p.Role)" />
    <PropertyColumn Property="@(p => p.Status)" />
</LumexDataGrid>

@if( _clickedRow is not null )
{
    <div class="text-small">
        <p>Row data: @_clickedRow.Item</p>
        <p>Row index: @_clickedRow.Index</p>
    </div>
}

@code {
    private readonly IQueryable<User> _users = new List<User>
    {
        new( "Alice Johnson", "Administrator", "Active" ),
        new( "Bob Smith", "Editor", "Inactive" ),
        new( "Charlie Brown", "Viewer", "Pending" ),
        new( "Diana Lee", "Moderator", "Active" )
    }.AsQueryable();

    private DataGridRowClickEventArgs<User>? _clickedRow;

    private void OnRowClickHandler( DataGridRowClickEventArgs<User> args )
    {
        _clickedRow = args;
    }

    private record User( string Name, string Role, string Status );
}