admin管理员组文章数量:1135111
Background
I'm learning C#, WPF and MVVM design pattern and I'm trying to create a window with some controls.
One of these controls is a CheckCombobox
taken from Xceed's Extended WPF Toolkit.
In this control, the property SelectedItemsOverride
holds a collection of all the checked items, and I'm binding a list called SelectedFilterParameters
to this property
The Problem
When the dropdown of the control closes after the user checked some items, no text is generated from the checked items, that represents the checked items. Instead the the text stays empty while there are indeed checked items in the control.
Worth mentioning && what I've tried
- Data bindings and functionality of the window works great
- Property
DisplayMemberPath="ValueToString"
is correct.ValueToString
is also being used in the<TextBlock>
tag below which works properly - I also tried
DisplayMemberPath="{Binding ValueToString}"
. Didn't work - I added a
RaisePropertyChange()
upon setting the checked items List which is bound to the control'sSelectedItemsOverride
property ItemsSource="{Binding ParameterValueList...
is just a list holding all the instances. Binds successfully
.cs
from which the problematic List is being bound, Bindable Base:
private IList<ParameterValueData> selectedFilterParameters;
/// <summary>
/// Selected parameters values, selected by the user using checkbox, to assign to the filter later under OR rule.
/// </summary>
public IList<ParameterValueData> SelectedFilterParameters
{
get { return selectedFilterParameters; }
set
{
selectedFilterParameters = value;
RaisePropertyChanged();
}
}
*.xaml
part in which I'm binding:
<DataGridTemplateColumn Header="Multiple Selection ComboBox" Width="199">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<xctk:CheckComboBox
ItemsSource="{Binding ParameterValueList, UpdateSourceTrigger=PropertyChanged}"
Delimiter=", "
Width="200"
SelectedItemsOverride="{Binding SelectedFilterParameters, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
DisplayMemberPath="ValueToString"
>
<xctk:CheckComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding ValueToString}"/>
</DataTemplate>
</xctk:CheckComboBox.ItemTemplate>
</xctk:CheckComboBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
Illustration
Desired text outcome:
CON18+5 Plaster, CON18+7 Plaster, CON20+2 Plaster
本文标签: cCheckCombobox Text property doesn39t work when user checks itemsStack Overflow
版权声明:本文标题:c# - CheckCombobox Text property doesn't work when user checks items - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736905687a1956006.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论