积极答复者
wpf ComboBox 数据转换问题

问题
-
在UI中有两个ComboBox:cmbMultiple, cmbValueList;
cmbMultiple,选项固定为:1,2,3,4;
cmbValueList,的选项在初始化时获取并绑定的ItemSources;
我要实现的效果为,cmbValueList显示的数据为根据cmbMultiple的选择进行的动态转换。
比如:cmbValueList绑定的值为:4,3,2,1,
当cmbMultiple选择1时,cmbValueList呈现:4,3,2,1,
当cmbMultiple选择2时,cmbValueList呈现:8,6,4,2,(也就是值乘2)
当cmbMultiple选择3时,cmbValueList呈现:12,9,6,3,(也就是值乘3)。。。。。。
如果是在DataGrid中进行绑定转换实现Converter类就可以了,可是在ComboBox中我就懵了,不知道该转换那个了?
答案
-
Hi blwuer,
欢迎来到中文论坛。
你可以不用converter转换来绑定ComboBox.具体请看:http://www.codeproject.com/Tips/322493/ComboBox-databinding-problem-solved-without-Conver
<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
Thanks
MSDN Community Support
Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.- 已标记为答案 Leo (Apple) YangModerator 2013年9月16日 8:32
全部回复
-
Hi blwuer,
欢迎来到中文论坛。
你可以不用converter转换来绑定ComboBox.具体请看:http://www.codeproject.com/Tips/322493/ComboBox-databinding-problem-solved-without-Conver
<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
Thanks
MSDN Community Support
Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.- 已标记为答案 Leo (Apple) YangModerator 2013年9月16日 8:32