HtmlForgeX

API Reference

Class

TablerDataGrid

Namespace HtmlForgeX
Assembly HtmlForgeX
Base Element

Enhanced Tabler DataGrid component that provides a fluent C# API for creating key-value data displays with rich content types, configurable spacing, responsive behavior, and all Tabler datagrid features without exposing HTML/CSS/JS knowledge requirements to users.

Inheritance

Constructors

Methods

public TablerDataGridItem AddAvatarItem(String title, String userName, Action<TablerAvatar> avatarConfig) #
Returns: TablerDataGridItem

Adds an avatar item with user information.

Parameters

title System.String requiredposition: 0
The title text.
userName System.String requiredposition: 1
The user name.
avatarConfig System.Action{HtmlForgeX.TablerAvatar} requiredposition: 2
Configuration action for the avatar.

Returns

The created TablerDataGridItem for further configuration.

public TablerDataGridItem AddAvatarListItem(String title, params Action<TablerAvatar>[] avatarConfigs) #
Returns: TablerDataGridItem

Adds an avatar list item with multiple users.

Parameters

title System.String requiredposition: 0
The title text.
avatarConfigs System.Action{HtmlForgeX.TablerAvatar}[] requiredposition: 1
Configuration actions for each avatar.

Returns

The created TablerDataGridItem for further configuration.

public TablerDataGridItem AddBadgeItem(String title, String badgeText, TablerColor color = Primary, TablerBadgeStyle style = Normal) #
Returns: TablerDataGridItem

Adds a badge item with specified color and style.

Parameters

title System.String requiredposition: 0
The title text.
badgeText System.String requiredposition: 1
The badge text.
color HtmlForgeX.TablerColor = Primary optionalposition: 2
The badge color.
style HtmlForgeX.TablerBadgeStyle = Normal optionalposition: 3
The badge style.

Returns

The created TablerDataGridItem for further configuration.

public TablerDataGridItem AddCheckboxItem(String title, Boolean isChecked = false, String label = null, String name = null) #
Returns: TablerDataGridItem

Adds a checkbox item.

Parameters

title System.String requiredposition: 0
The title text.
isChecked System.Boolean = false optionalposition: 1
Whether the checkbox is checked.
label System.String = null optionalposition: 2
Optional label for the checkbox.
name System.String = null optionalposition: 3
Optional name attribute.

Returns

The created TablerDataGridItem for further configuration.

public TablerDataGridItem AddFormControlItem(String title, String inputType = "text", String placeholder = null, String value = null, String name = null) #
Returns: TablerDataGridItem

Adds a form control item (input field).

Parameters

title System.String requiredposition: 0
The title text.
inputType System.String = "text" optionalposition: 1
The input type.
placeholder System.String = null optionalposition: 2
Optional placeholder text.
value System.String = null optionalposition: 3
Optional default value.
name System.String = null optionalposition: 4
Optional name attribute.

Returns

The created TablerDataGridItem for further configuration.

public TablerDataGridItem AddIconItem(String title, TablerIconType iconType, String text = null, Nullable<TablerColor> color = null) #
Returns: TablerDataGridItem

Adds an icon item with optional text.

Parameters

title System.String requiredposition: 0
The title text.
iconType HtmlForgeX.TablerIconType requiredposition: 1
The icon type.
text System.String = null optionalposition: 2
Optional text to display with the icon.
color System.Nullable{HtmlForgeX.TablerColor} = null optionalposition: 3
Optional icon color.

Returns

The created TablerDataGridItem for further configuration.

AddItem 4 overloads
public TablerDataGrid AddItem(TablerDataGridItem item) #
Returns: TablerDataGrid

Adds a new data grid item using a configuration action.

Parameters

config System.Action{HtmlForgeX.TablerDataGridItem} requiredposition: 0
Configuration action for the item.

Returns

The TablerDataGrid for method chaining.

AddItem(HtmlForgeX.TablerDataGridItem item) #

Adds a pre-configured data grid item.

Parameters

item HtmlForgeX.TablerDataGridItem required
The data grid item to add.

Returns

The TablerDataGrid for method chaining.

public TablerDataGridItem AddItem(String title, Element content) #
Returns: TablerDataGridItem

Adds a simple title-content item.

Parameters

title System.String requiredposition: 0
The title text.
content System.String requiredposition: 1
The content text.

Returns

The created TablerDataGridItem for further configuration.

AddItem(System.String title, HtmlForgeX.Element content) #

Adds a title-element item.

Parameters

title System.String required
The title text.
content HtmlForgeX.Element required
The content element.

Returns

The created TablerDataGridItem for further configuration.

public TablerDataGridItem AddStatusItem(String title, String statusText, TablerColor color = Success) #
Returns: TablerDataGridItem

Adds a status item with specified color.

Parameters

title System.String requiredposition: 0
The title text.
statusText System.String requiredposition: 1
The status text.
color HtmlForgeX.TablerColor = Success optionalposition: 2
The status color.

Returns

The created TablerDataGridItem for further configuration.

public TablerDataGrid AsCompact() #
Returns: TablerDataGrid
EditorBrowsable(2)

Creates a compact data grid with reduced spacing.

Returns

The TablerDataGrid for method chaining.

public TablerDataGrid AsFullyResponsive() #
Returns: TablerDataGrid
EditorBrowsable(2)

Enables full responsive behavior.

Returns

The TablerDataGrid for method chaining.

public TablerDataGrid AsMobileResponsive() #
Returns: TablerDataGrid
EditorBrowsable(2)

Enables mobile-responsive behavior.

Returns

The TablerDataGrid for method chaining.

public TablerDataGrid AsSpacious() #
Returns: TablerDataGrid
EditorBrowsable(2)

Creates a spacious data grid with increased spacing.

Returns

The TablerDataGrid for method chaining.

public TablerDataGrid AsTiles(String minWidth = null) #
Returns: TablerDataGrid
EditorBrowsable(2)

Arrange items as responsive tiles that fill each row evenly using Flex. Useful for short, panel-like items (e.g., PingCastle/PurpleKnight badges) where two items should render 50/50, three items 33/33/33, etc.

Parameters

minWidth System.String = null optionalposition: 0
Minimum tile width (e.g., "18rem", "320px").
public TablerDataGrid NaturalTitles(Boolean enable = true) #
Returns: TablerDataGrid
EditorBrowsable(2)

Renders all item titles in natural case (as authored) rather than Tabler's uppercase style.

Parameters

enable System.Boolean = true optionalposition: 0
RegisterLibraries() #

Registers lightweight layout helpers when tile/flow mode is used.

public TablerDataGrid Settings(Action<DataGridSettings> configure) #
Returns: TablerDataGrid

Groups less-common options under a single fluent entry point to keep IntelliSense lean.

Parameters

configure System.Action{HtmlForgeX.DataGridSettings} requiredposition: 0
public TablerDataGrid Surface(TablerSurfaceStyle style) #
Returns: TablerDataGrid
EditorBrowsable(2)

Applies a shared surface treatment to the data grid shell.

Parameters

style HtmlForgeX.TablerSurfaceStyle requiredposition: 0
public TablerDataGridItem Title(String title) #
Returns: TablerDataGridItem

Creates a new item and returns it for inline configuration.

Parameters

title System.String requiredposition: 0
The title text.

Returns

The created TablerDataGridItem for configuration chaining.

public override String ToString() #
Returns: String

Generates the HTML output for the data grid.

Returns

The HTML string representation.

public TablerDataGrid WithCustomClasses(String cssClasses) #
Returns: TablerDataGrid
EditorBrowsable(2)

Adds custom CSS classes to the container (for advanced users).

Parameters

cssClasses System.String requiredposition: 0
Additional CSS classes.

Returns

The TablerDataGrid for method chaining.

public TablerDataGrid WithCustomDefaultTitleWidth(String customWidth) #
Returns: TablerDataGrid
EditorBrowsable(2)

Sets custom default title width for all items.

Parameters

customWidth System.String requiredposition: 0
Custom CSS width value.

Returns

The TablerDataGrid for method chaining.

public TablerDataGrid WithCustomSpacing(String customSpacing) #
Returns: TablerDataGrid
EditorBrowsable(2)

Sets custom spacing between grid items.

Parameters

customSpacing System.String requiredposition: 0
Custom CSS spacing value.

Returns

The TablerDataGrid for method chaining.

public TablerDataGrid WithCustomStyle(String cssStyle) #
Returns: TablerDataGrid
EditorBrowsable(2)

Sets custom CSS styles for the data grid container.

Parameters

cssStyle System.String requiredposition: 0
Custom CSS style string.

Returns

The TablerDataGrid for method chaining.

public TablerDataGrid WithDefaultTitleWidth(TablerDataGridTitleWidth width) #
Returns: TablerDataGrid
EditorBrowsable(2)

Sets the default title width for all items.

Parameters

width HtmlForgeX.TablerDataGridTitleWidth requiredposition: 0
The default title width.

Returns

The TablerDataGrid for method chaining.

public TablerDataGrid WithLayout(TablerDataGridLayout layout) #
Returns: TablerDataGrid
EditorBrowsable(2)

Sets the layout style for the data grid.

Parameters

layout HtmlForgeX.TablerDataGridLayout requiredposition: 0
The layout style.

Returns

The TablerDataGrid for method chaining.

public TablerDataGrid WithMargin(TablerMargin margin) #
Returns: TablerDataGrid
EditorBrowsable(2)

Sets margin using Tabler margin utilities.

Parameters

margin HtmlForgeX.TablerMargin requiredposition: 0
The margin value.

Returns

The TablerDataGrid for method chaining.

public TablerDataGrid WithNarrowTitles() #
Returns: TablerDataGrid
EditorBrowsable(2)

Sets narrow title widths for compact display.

Returns

The TablerDataGrid for method chaining.

public TablerDataGrid WithPadding(TablerPadding padding) #
Returns: TablerDataGrid
EditorBrowsable(2)

Sets padding using Tabler padding utilities.

Parameters

padding HtmlForgeX.TablerPadding requiredposition: 0
The padding value.

Returns

The TablerDataGrid for method chaining.

public TablerDataGrid WithResponsive(TablerDataGridResponsive responsive) #
Returns: TablerDataGrid
EditorBrowsable(2)

Sets the responsive behavior for the data grid.

Parameters

responsive HtmlForgeX.TablerDataGridResponsive requiredposition: 0
The responsive behavior.

Returns

The TablerDataGrid for method chaining.

public TablerDataGrid WithSpacing(TablerDataGridSpacing spacing) #
Returns: TablerDataGrid
EditorBrowsable(2)

Sets the spacing between grid items using predefined values.

Parameters

spacing HtmlForgeX.TablerDataGridSpacing requiredposition: 0
The spacing value.

Returns

The TablerDataGrid for method chaining.

public TablerDataGrid WithWideTitles() #
Returns: TablerDataGrid
EditorBrowsable(2)

Sets wide title widths for spacious display.

Returns

The TablerDataGrid for method chaining.

Properties

public List<TablerDataGridItem> Items { get; set; } #

Gets the collection of items displayed within the grid.