简体   繁体   English

WPF扩展工具包-CheckComboBox SelectedValue排序

[英]WPF Extended Toolkit - CheckComboBox SelectedValue Ordering

I'm having the situation where when I check items in the combo box it orders the comma delimited selectedvalue according to the order of the items in the drop down. 我遇到一种情况,当我检查组合框中的项目时,它会根据下拉列表中项目的顺序对逗号定界的selectedValue进行排序。 So for example. 例如。

If I have the following dropdown: 如果我有以下下拉菜单:

[] A
[] B 
[] C

And I then go ahead and first tick B then C and then A. The selectedvalue then shows A,B,C and not B,C,A. 然后我继续,首先在B上打勾,然后在C上打勾,然后在A上打勾。selectedvalue然后显示A,B,C而不是B,C,A。 Which means that for some reason the values are being sorted after selection. 这意味着出于某种原因,这些值会在选择后进行排序。 From tests it seems to sort the comma delimited selectedvalue to be in the same order as the order they appear in the dropdown. 从测试看来,用逗号定界的selectedvalue排序的顺序与它们在下拉列表中出现的顺序相同。 How can I disable this so that it doesn't sort the selectedvalue? 如何禁用此功能,以便不对selectedvalue进行排序? I want to have the selected value read B,C,A in the order I selected them. 我想让所选值按我选择它们的顺序读取B,C,A。

Ok so I seemed to discover my problem minutes after I made the post. 好的,所以我似乎在发帖后几分钟就发现了自己的问题。 I had the IsAsync attribute set to true on the binding of my SelectedValue and for some reason this caused the SelectedValue to be ordered. 在我的SelectedValue的绑定中,我将IsAsync属性设置为true,由于某种原因,这导致SelectedValue被排序。 Not sure why though, but as soon as I removed the IsAsync=True everything was normal. 虽然不知道为什么,但是当我删除I​​sAsync = True时,一切正常。

Was: 是:

SelectedValue="{Binding Occurrence.Appointment.SelectedRows, Mode=TwoWay, IsAsync=True}" >

Now: 现在:

SelectedValue="{Binding Occurrence.Appointment.SelectedRows, Mode=TwoWay}"

Hope this helps someone someday with similar problem. 希望有一天有类似问题的人能有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM