MudBlazor

MudTable<T> API

Pages

Properties

Name Type Default Description
ChildRowContent
RenderFragment<T>

null

Row Child content of the component.
Columns
RenderFragment<T>

Defines how a table column looks like. Columns components should inherit from MudBaseColumn
Filter
Func<T, Boolean>

null

A function that returns whether or not an item should be displayed in the table. You can use this to implement your own search function.
GroupBy
TableGroupDefinition<T>

null

Defines data grouping parameters. It can has N hierarchical levels
GroupFooterClass
String

null

Defines custom CSS classes for using on Group Footer's MudTr.
GroupFooterStyle
String

null

Defines custom styles for using on Group Footer's MudTr.
GroupFooterTemplate
RenderFragment<TableGroupData<Object, T>>

null

Defines how a table grouping row footer looks like. It works only when GroupBy is not null. Use MudTd to define the table cells and their content.
GroupHeaderClass
String

null

Defines custom CSS classes for using on Group Header's MudTr.
GroupHeaderStyle
String

null

Defines custom styles for using on Group Header's MudTr.
GroupHeaderTemplate
RenderFragment<TableGroupData<Object, T>>

null

Defines how a table grouping row header looks like. It works only when GroupBy is not null. Use MudTd to define the table cells and their content.
HorizontalScrollbar
Boolean

False

Defines if the table has a horizontal scrollbar.
Items
IEnumerable<T>

null

The data to display in the table. MudTable will render one row per item
LoadingContent
RenderFragment

null

Defines the table body content the table has no rows and is loading
NoRecordsContent
RenderFragment

null

Defines the table body content when there are no matching records found
QuickColumns
String

null

Comma separated list of columns to show if there is no templates defined
RowClassFunc
Func<T, Int32, String>

null

Returns the class that will get joined with RowClass. Takes the current item and row index.
RowEditingTemplate
RenderFragment<T>

null

Defines how a table row looks like in edit mode (for selected row). Use MudTd to define the table cells and their content.
RowStyleFunc
Func<T, Int32, String>

null

Returns the style that will get joined with RowStyle. Takes the current item and row index.
RowTemplate
RenderFragment<T>

null

Defines how a table row looks like. Use MudTd to define the table cells and their content.
SelectedItem
T

null

Returns the item which was last clicked on in single selection mode (that is, if MultiSelection is false)
SelectedItems
HashSet<T>

If MultiSelection is true, this returns the currently selected items. You can bind this property and the initial content of the HashSet you bind it to will cause these rows to be selected initially.
ServerData
Func<TableState, Task<TableData<T>>>

null

Supply an async function which (re)loads filtered, paginated and sorted data from server. Table will await this func and update based on the returned TableData. Used only with ServerData
Inherited from MudTableBase
AllowUnsorted
Boolean

True

If true allows table to be in an unsorted state through column clicks (i.e. first click sorts "Ascending", second "Descending", third "None"). If false only "Ascending" and "Descending" states are allowed (i.e. there always should be a column to sort).
Bordered
Boolean

False

If true, table's cells will have left/right borders.
Breakpoint
Breakpoint

Breakpoint.Xs

At what breakpoint the table should switch to mobile layout. Takes None, Xs, Sm, Md, Lg and Xl the default behavior is breaking on Xs.
CanCancelEdit
Boolean

False

Define if Cancel button is present or not for inline editing.
CancelEditIcon
String
Sets the Icon of the CancelEdit Button.
CancelEditTooltip
String

null

Tooltip for the CancelEdit Button.
ColGroup
RenderFragment

null

Specifies a group of one or more columns in a table for formatting. Ex: table colgroup col span="2" style="background-color:red" col style="background-color:yellow" colgroup header body table
CommitEditCommand
ICommand

null

Command executed when the user clicks on the CommitEdit Button.
CommitEditCommandParameter
Object

null

Command parameter for the CommitEdit Button. By default, will be the row level item model, if you won't set anything else.
CommitEditIcon
String
Sets the Icon of the CommitEdit Button.
CommitEditTooltip
String

null

Tooltip for the CommitEdit Button.
CurrentPage
Int32

0

The page index of the currently displayed page (Zero based). Usually called by MudTablePager. Note: requires a MudTablePager in PagerContent.
CustomFooter
Boolean

False

Specify if the footer has multiple rows. In that case, you need to provide the MudTFootRow tags.
CustomHeader
Boolean

False

Specify if the header has multiple rows. In that case, you need to provide the MudTHeadRow tags.
Dense
Boolean

False

Set true for rows with a narrow height
Elevation
Int32

1

The higher the number, the heavier the drop-shadow. 0 for no shadow.
FixedFooter
Boolean

False

When true, the footer will be visible is not scrolled to the bottom. Note: set Height to make the table scrollable.
FixedHeader
Boolean

False

When true, the header will stay in place when the table is scrolled. Note: set Height to make the table scrollable.
FooterClass
String

null

Add a class to the tfoot tag
FooterContent
RenderFragment

null

Add MudTd cells here to define the table footer. If is set, add one or more MudTFootRow instead.
HeaderClass
String

null

Add a class to the thead tag
HeaderContent
RenderFragment

null

Add MudTh cells here to define the table header. If is set, add one or more MudTHeadRow instead.
Height
String

null

Setting a height will allow to scroll the table. If not set, it will try to grow in height. You can set this to any CSS value that the attribute 'height' accepts, i.e. 500px.
Hover
Boolean

False

Set true to see rows hover on mouse-over.
Loading
Boolean

False

Show a loading animation, if true.
LoadingProgressColor
Color

Color.Info

The color of the loading progress if used. It supports the theme colors.
MultiSelection
Boolean

False

Set to true to enable selection of multiple rows with check boxes.
Outlined
Boolean

False

If true, table will be outlined.
PagerContent
RenderFragment

null

Add MudTablePager here to enable breaking the rows in to multiple pages.
ReadOnly
Boolean

False

Locks Inline Edit mode, if true.
RowClass
String

null

CSS class for the table rows. Note, many CSS settings are overridden by MudTd though
RowEditCancel
Action<Object>

null

The method is called when the edition of the item has been canceled in inline editing.
RowEditCommit
Action<Object>

null

The method is called when the edition of the item has been committed in inline editing.
RowEditPreview
Action<Object>

null

The method is called before the item is modified in inline editing.
RowsPerPage
Int32

10

If the table has more items than this number, it will break the rows into pages of said size. Note: requires a MudTablePager in PagerContent.
RowStyle
String

null

CSS styles for the table rows. Note, many CSS settings are overridden by MudTd though
SortLabel
String

null

If table is in smalldevice mode and uses any kind of sorting the text applied here will be the sort selects label.
Square
Boolean

False

Set true to disable rounded corners
Striped
Boolean

False

If true, striped table rows will be used.
ToolBarContent
RenderFragment

null

Optional. Add any kind of toolbar to this render fragment.
TotalItems
Int32

0

Number of items. Used only with ServerData="true"
Virtualize
Boolean

False

If true, the results are displayed in a Virtualize component, allowing a boost in rendering speed.
Inherited from MudComponentBase
Class
String

null

User class names, separated by space.
Style
String

null

User styles, applied on top of the component's own classes and styles.
Tag
Object

null

Use Tag to attach any user data object to the component for your convenience.
UserAttributes
Dictionary<String, Object>

UserAttributes carries all attributes you add to the component that don't match any of its parameters. They will be splatted onto the underlying HTML tag.

EventCallbacks

Name Type Description
OnCancelEditClick
EventCallback<MouseEventArgs>
Button cancel edit click event.
OnCommitEditClick
EventCallback<MouseEventArgs>
Button commit edit click event.
OnPreviewEditClick
EventCallback<Object>
Event is called before the item is modified in inline editing.
OnRowClick
EventCallback<TableRowClickEventArgs<T>>
Button click event.
RowsPerPageChanged
EventCallback<Int32>
Rows Per Page two-way bindable parameter
SelectedItemChanged
EventCallback<T>
Callback is called when a row has been clicked and returns the selected item.
SelectedItemsChanged
EventCallback<HashSet<T>>
Callback is called whenever items are selected or deselected in multi selection mode.

Methods

Name Parameters Return Description
int GetFilteredItemsCount()
int
NavigateTo(Page page)
Page page
NavigateTo(int pageIndex)
int pageIndex : The index of the page number.
Navigate to page with specified index.
Task ReloadServerData()
Task
Call this to reload the server-filtered, -sorted and -paginated items
SetEditingItem(object item)
object item
SetRowsPerPage(int size)
int size
SetSelectedItem(object item)
object item
An error has occurred. This application may no longer respond until reloaded. Reload 🗙