Skip to content

MudTable: Add row disabled#12441

Merged
danielchalmers merged 17 commits intoMudBlazor:devfrom
91378246:feature/mud-table-add-row-disabled
Jan 31, 2026
Merged

MudTable: Add row disabled#12441
danielchalmers merged 17 commits intoMudBlazor:devfrom
91378246:feature/mud-table-add-row-disabled

Conversation

@91378246
Copy link
Contributor

This PR adds a RowDisabledFunc to the MudTable which allows to disable rows based on a condition. Real world usage would be for example a list of items I display in my user facing app of which some are currently hidden for the user.

This PR also adds cursor: pointer to tables with hover enabled to indicate to a user that this table is interactive. In addition, some minor code touchups were made.

table

@mudbot mudbot bot added the enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library label Jan 14, 2026

This comment was marked as spam.

@91378246
Copy link
Contributor Author

@danielchalmers Does copilot have a stroke or do I? His comments don't really make sense do they?

@danielchalmers
Copy link
Member

@danielchalmers Does copilot have a stroke or do I? His comments don't really make sense do they?

Copilot has been messing up a LOT the last 24 hrs. Ignore for now, sorry!

Copy link
Contributor

@Anu6is Anu6is left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor formatting

@ScarletKuro
Copy link
Member

Conflicts after merging #12447

# Conflicts:
#	src/MudBlazor.Docs/Pages/Components/Table/Examples/TableRowClassFuncExample.razor
#	src/MudBlazor.Docs/Pages/Components/Table/TablePage.razor
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 10 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +92 to +116
/// <summary>
/// The function which determines if a row is disabled.
/// A disabled row ignores mouse events and uses <c>--mud-palette-text-disabled</c> as color.
/// </summary>
/// <remarks>
/// Make the function return <c>true</c> to diable the corresponding row. When no value is set, all rows are considered enabled.
/// </remarks>
[Parameter]
[Category(CategoryTypes.Table.Behavior)]
public Func<T, bool>? RowDisabledFunc { get; set; }

/// <summary>
/// The class to use for disabled rows.
/// </summary>
/// <remarks>
/// Defaults to <c>mud-table-row-disabled</c>
/// </remarks>
[Parameter]
[Category(CategoryTypes.Table.Appearance)]
public string DisabledRowClass { get; set; } = "mud-table-row-disabled";

private bool IsRowDisabled(T item)
{
return RowDisabledFunc != null && RowDisabledFunc(item);
}
Copy link

Copilot AI Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new RowDisabledFunc feature lacks test coverage. Consider adding unit tests to verify that:

  1. Disabled rows apply the correct CSS class
  2. Disabled rows don't respond to click events
  3. Disabled rows can't be selected when MultiSelection is enabled
  4. The IsRowDisabled method correctly evaluates the function
  5. The DisabledRowClass parameter can be customized

Copilot uses AI. Check for mistakes.
@ScarletKuro
Copy link
Member

lgtm

This was referenced Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Adds a new feature or enhances existing functionality (not fixing a defect) in the main library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants