Skip to content

多选控件与枚举类型,在表单控件中可以选择,在表格控件中不可选择 #3192

Answered by ArgoZhang
yangf85 asked this question in Q&A
Discussion options

You must be logged in to vote

@yangf85 这个问题已经说过无数次了,参考文档链接如下:

https://www.blazor.zone/table/edit#EditTemplate

自定义如下代码如下:

@using static BootstrapTest.Server.Components.Pages.TableTest

<MultiSelect DisplayText="分类" @bind-Value=Categories />

@code {
    [Parameter]
    public List<SummaryCategory>? Categories { get; set; }

    [Parameter]
    public EventCallback<List<SummaryCategory>?> CategoriesChanged { get; set; }
}

原模板更改为

<EditTemplate Context="item">
    <div class="col-12" >
        <Component @bind-Categories="context.Categories"></Component>
    </div>
</EditTemplate>

帮忙点一下下面的 Mark as answer 按钮

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by yangf85
Comment options

You must be logged in to vote
1 reply
@ArgoZhang
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Question that needs to be answered
2 participants
Converted from issue

This discussion was converted from issue #3186 on April 01, 2024 11:07.