How to maintain constant width of MudSelect element in RowEditingTemplate
Asked Answered
A

1

6

I am running into an issue where the width of my MudSelect element will change based on the length of the selected item when it is within a RowEditingTemplate.

In order to demonstrate the issue, I have added the a MudSelect element to the "Position" column in this table; it is viewable below.

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

How can I format this so that the length of the MudSelect does not vary based on the length of the selection?

Azoic answered 10/9, 2021 at 19:39 Comment(0)
A
2

I had the same issue:

@foreach (var item in positionList)
                {
                    <MudSelectItem Value="@item">@item</MudSelectItem>
                }

If you do this instead:

@foreach (var item in positionList)
            {
                <MudSelectItem Value="@(item.Name)" />
            }

Then the width should be static.

Amendatory answered 16/8, 2022 at 12:47 Comment(3)
I took a look at the OPs code and the items do not have a name. They're just int. Furthermore, it can have serious consequences because now we do not refer to the object by reference but by names which aren't necessarily unambiguous. Please elaborate.Whisenant
any progress on this @Jan?Srinagar
Yes here is the solution that worked for me: #76473999Blackfellow

© 2022 - 2024 — McMap. All rights reserved.