MudBlazor/MudBlazor

DisplayTemplate for MudSelect

Ouverte

#2 861 ouverte le 28 sept. 2021

 (8 commentaires) (0 réaction) (1 personne assignée)C# (1 631 forks)batch import
enhancementhelp wanted

Métriques du dépôt

Stars
 (10 394 étoiles)
Métriques de merge PR
 (Merge moyen 6j 6h) (108 PRs mergées en 30 j)

Description

Feature request type

Enhance component

Component name

MudSelect

Is your feature request related to a problem?

No response

Describe the solution you'd like

MudSelect is a very powerful bindable select. However, when binding to a complete object instead of primite field, the ToString method is called. As workaround, override ToString works, but is not as flexible as have template.

I suggest to have a property for been able to customize the display for the selected item.

Like

<MudSelect ...>
<SelectedItemDisplayTemplate>
<span style="color:red">@Context.SelectedMember</span>
</SelectedItemDisplayTemplate>
</MudSelect>

Have you seen this feature anywhere else?

No response

Describe alternatives you've considered

No response

Pull Request

  • I would like to do a Pull Request

Code of Conduct

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

Guide contributeur