MudBlazor/MudBlazor

DisplayTemplate for MudSelect

開放

#2,861 建立於 2021年9月28日

 (8 則留言) (0 個反應) (1 位負責人)C# (1,631 個分叉)batch import
enhancementhelp wanted

倉庫指標

星標
 (10,394 顆星)
PR 合併指標
 (平均合併 6天 6小時) (30 天內合併 108 個 PR)

描述

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

貢獻者指南