Class BOBDataGrid<TItem>
- Namespace
- BlazOrbit.Components
- Assembly
- BlazOrbit.dll
[GenerateComponentInfo]
public class BOBDataGrid<TItem> : BOBDataCollectionBase<TItem, BOBDataGrid<TItem>, DataGridVariant>, IVariantComponent<DataGridVariant>, IVariantComponent, IPureBuiltComponent, IBuiltComponent, IHasDensity, IHasSize, IHasShadow, IHasBorder, IHasBackgroundColor, IDataCollectionFamilyComponent
Type Parameters
TItem
- Inheritance
-
objectComponentBaseBOBDataGrid<TItem>
- Implements
- Inherited Members
-
BOBDataCollectionBase<TItem, BOBDataGrid<TItem>, DataGridVariant>.HandleHeaderDragEnd(DragEventArgs)BOBDataCollectionBase<TItem, BOBDataGrid<TItem>, DataGridVariant>.HandlePageSizeSelectChange(string)
Constructors
BOBDataGrid()
public BOBDataGrid()
Properties
BuiltInTemplates
Compile-time map of variants to their built-in render templates.
protected override IReadOnlyDictionary<DataGridVariant, Func<BOBDataGrid<TItem>, RenderFragment>> BuiltInTemplates { get; }
Property Value
- IReadOnlyDictionary<DataGridVariant, Func<BOBDataGrid<TItem>, RenderFragment>>
CellBorder
Border style applied to individual cells.
[Parameter]
public BorderStyle? CellBorder { get; set; }
Property Value
Copyable
When true, the toolbar shows a "Copy" button that writes the current
filtered + sorted view to the system clipboard as TSV (text/plain) and an HTML
<table> (text/html) so the payload pastes natively into Excel,
Sheets, and Numbers. Opt-in (defaults to false) — every grid in the
wild stays unchanged unless the consumer enables the feature explicitly.
[Parameter]
public bool Copyable { get; set; }
Property Value
- bool
DefaultVariant
Variant used when no Variant is supplied.
public override DataGridVariant DefaultVariant { get; }
Property Value
EditMode
Inline-edit strategy. None (default) keeps the grid read-only. Cell activates per-cell editing on double-click; Batch stages changes until the toolbar Save / Cancel actions commit them.
[Parameter]
public BOBDataGridEditMode EditMode { get; set; }
Property Value
FixedHeader
When true, the header row stays fixed while scrolling.
[Parameter]
public bool FixedHeader { get; set; }
Property Value
- bool
FooterTemplate
Custom template rendered inside the table footer.
[Parameter]
public RenderFragment? FooterTemplate { get; set; }
Property Value
- RenderFragment
OnCopy
Raised after the grid has serialised + written the clipboard payload. The event arg carries the item snapshot and both payloads so the consumer can surface a toast ("N rows copied"), audit, or log — the grid itself is intentionally feedback-free to avoid coupling to IToastService in core grid code.
[Parameter]
public EventCallback<BOBDataGridCopyEventArgs<TItem>> OnCopy { get; set; }
Property Value
- EventCallback<BOBDataGridCopyEventArgs<TItem>>
OnRowCancel
Raised when the user discards an in-progress edit via Escape (cell mode) or
the toolbar Cancel action (batch mode). The handler receives the row item before
the grid restores its original value.
[Parameter]
public EventCallback<TItem> OnRowCancel { get; set; }
Property Value
- EventCallback<TItem>
OnRowSave
Raised after a row's edit is committed (Enter, blur, or — in batch mode — the toolbar Save action). The handler receives the mutated row item so the consumer can persist the change to the backing store.
[Parameter]
public EventCallback<TItem> OnRowSave { get; set; }
Property Value
- EventCallback<TItem>
RowBorder
Border style applied to rows.
[Parameter]
public BorderStyle? RowBorder { get; set; }
Property Value
RowTemplate
Custom template for rendering each data row.
[Parameter]
public RenderFragment<TItem>? RowTemplate { get; set; }
Property Value
- RenderFragment<TItem>
Methods
BuildComponentCssVariables(Dictionary<string, string>)
Contributes CSS custom properties on the root <bob-component> for the active row pattern.
public override void BuildComponentCssVariables(Dictionary<string, string> cssVariables)
Parameters
cssVariablesDictionary<string, string>
BuildRenderTree(RenderTreeBuilder)
Renders the component to the supplied Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
__builderRenderTreeBuilder