MudBlazor/MudBlazor

Doc: MudDataGrid example "Column Types" breaks when cell content spans over multiple lines

Open

#10976 opened on Mar 7, 2025

View on GitHub
 (1 comment) (0 reactions) (0 assignees)C# (10,394 stars) (1,631 forks)batch import
docsgood first issuehas workaround

Description

Things to check

  • I have searched the existing issues for this bug
  • To rule out a caching problem I made sure the bug also happens in an incognito tab

Bug type

Docs (mudblazor.com)

Component name

MudDataGrid

What happened?

Not sure if this is actually an issue but it's something that can be definitely improved.

In the MudDataGrid documentation there is an example about inserting buttons and other elements in a column: Column Types

The user is likely to use such example as starting point to build DataGrids with such characteristics. However, if you have the content of a cell spanning over multiple lines, you'll notice that the layout of the cell containing custom elements will broke. Please see this code snippet created by copying the code in the doc, removing unnecessary columns and inserting a long text in a cell.

Expected behavior

I'd expect that if I embed the code from the example in my solution, it doesn't break as soon as there is a cell with a multiline content.

Workaround

There actually is a solution, which is to move the CSS classes from the TemplateColumn element to the MudStack element, such as in the following code snippet

Reproduction link

https://try.mudblazor.com/snippet/GYGTERYqTrGkqCBG

Reproduction steps

  1. Copy the code from MudDataGrid example Column Types
  2. Edit the content of a text cell such that it spans over multiple lines of text.

Version (bug)

The version used in try.mudblazor, currently I guess 8.3.0

What browsers are you seeing the problem on?

Edge

On which operating systems are you experiencing the issue?

Windows

Pull Request

  • I would like to do a Pull Request

Code of Conduct

  • I agree to follow this project's Code of Conduct

Contributor guide