Row Actions in Blazor Tree Grid
The Ignite UI for Blazor Row Actions feature in Blazor Tree Grid enables developers to use an IgbActionStrip and utilize CRUD for row/cell components and row pinning. There are several predefined UI controls for these operations that are applicable to a specific row in the IgbTreeGrid – editing and pinning.
Usage
The predefined actions UI components are:
-
IgbGridEditingActions- includes functionality and UI specifically designed for theIgbTreeGridediting. It allows you to quickly toggle edit mode for cells or rows, depending on theIgbTreeGrid.RowEditableoption and row deletion of theIgbTreeGrid. -
IgbGridPinningActions- includes functionality and UI specifically designed for theIgbTreeGridrow pinning. It allows you to quickly pin rows and navigate between pinned rows and their disabled counterparts.
They are added inside the IgbTreeGrid and this is all needed to have an IgbActionStrip providing default interactions.
<IgbGrid Data=northwindEmployees RowEditable="True" PrimaryKey="ID">
@foreach (var c in columns)
{
<IgbColumn Field="@c.Field">
</IgbColumn>
}
<IgbActionStrip @ref=actionstrip>
<IgbGridPinningActions></IgbGridPinningActions>
<IgbGridEditingActions></IgbGridEditingActions>
</IgbActionStrip>
</IgbGrid>
<IgbTreeGrid Data=northwindEmployees RowEditable="True" PrimaryKey="ID">
@foreach (var c in columns)
{
<IgbColumn Field="@c.Field">
</IgbColumn>
}
<IgbActionStrip @ref=actionstrip>
<IgbGridPinningActions></IgbGridPinningActions>
<IgbGridEditingActions></IgbGridEditingActions>
</IgbActionStrip>
</IgbTreeGrid>
When IgbActionStripComponent is a child component of the IgbTreeGrid, hovering a row will automatically show the UI.
Custom Implementation
These components expose templates giving flexibility for customization. For instance, if we would like to use the IgbActionStrip for a Gmail scenario with row actions such as delete, edit and etc. You can simply create button component with icon, add click event to it and insert it into the IgbActionStrip.
<div class="grid__wrapper">
<IgbTreeGrid Data=northwindEmployees>
<IgbActionStrip @ref=actionstrip>
<IgbGridPinningActions></IgbGridPinningActions>
<IgbGridEditingActions
EditRow="true"
DeleteRow="true"
AddRow="true">
</IgbGridEditingActions>
</IgbActionStrip>
</IgbTreeGrid>
</div>