Skip to content

Select 控件无法正常选择值 #3016

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

You must be logged in to vote

绑定的是枚举类型导致的,枚举类型内部做了特殊处理不需要 Items

更改代码如下:
···
<Select@bind-Value="@showType" OnSelectedItemChanged="OnSelectedItemChanged">Show/Hide
···

即可

或者集合更改为

ShowTypeSourceItems.Add(new SelectedItem("ShowNone", "ShowNone"));
ShowTypeSourceItems.Add(new SelectedItem("ShowNumber", "ShowNumber"));
ShowTypeSourceItems.Add(new SelectedItem("ShowZodiac", "ShowZodiac"));

不支持 int 枚举字符串形式

Replies: 2 comments

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 xunmeng2002
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
question Further information is requested
2 participants
Converted from issue

This discussion was converted from issue #3009 on February 29, 2024 10:55.