Open EDanilkov opened 5 years ago
Hi, Thanks for reporting this. Wiki will be updated to use SelectedItemsOverride property.
Is this the official fix, to use the stated property instead of the one in the documentation? I notice the documentation still hasn't changed (DianeXceed edited this page on Jun 21, 2017) in 3 years and this issue is almost 3 months old.
When I bind a property to the one stated, I'm not getting the property set
<xctk:CheckComboBox Grid.Column="2" Delimiter="/" ItemsSource="{StaticResource Strings}" SelectedItemsOverride="{Binding Holder}"/>
UPDATE - I did fix my problem. I assumed the SelectedItemsOverride
property would pass me an instance of an IList
with the items that were selected. I had to create an instance of a type implementing IList
in my VM item and the control then populated the items were added and removed to the list as I thought.
Also, I'm using it in an ItemsControl
and I had to set the DataContext
of the combo to {Binding}
so the correct items were referred to in my local binding. Here is what the Check Combo looks like in my DataTemplate
now:
<xctk:CheckComboBox Grid.Column="2" Delimiter="/" DataContext="{Binding}" ItemsSource="{StaticResource Strings}" DisplayMemberPath="Value" SelectedItemsOverride="{Binding BenefitTypes}"/>
Next problem I had was the IList BenefitType
property on my object was of type 'List<>and not
ObservableCollection<>`. this kept the CB from updating the text display. Another caveat.
Posting this hoping that it will help someone out since these things are not clear in the documentation.
Thanks.
Is this the official fix, to use the stated property instead of the one in the documentation? I notice the documentation still hasn't changed (DianeXceed edited this page on Jun 21, 2017) in 3 years and this issue is almost 3 months old.
When I bind a property to the one stated, I'm not getting the property set
<xctk:CheckComboBox Grid.Column="2" Delimiter="/" ItemsSource="{StaticResource Strings}" SelectedItemsOverride="{Binding Holder}"/>
UPDATE - I did fix my problem. I assumed the
SelectedItemsOverride
property would pass me an instance of anIList
with the items that were selected. I had to create an instance of a type implementingIList
in my VM item and the control then populated the items were added and removed to the list as I thought.Also, I'm using it in an
ItemsControl
and I had to set theDataContext
of the combo to{Binding}
so the correct items were referred to in my local binding. Here is what the Check Combo looks like in myDataTemplate
now:
<xctk:CheckComboBox Grid.Column="2" Delimiter="/" DataContext="{Binding}" ItemsSource="{StaticResource Strings}" DisplayMemberPath="Value" SelectedItemsOverride="{Binding BenefitTypes}"/>
Next problem I had was the
IList BenefitType
property on my object was of type 'List<>and not
ObservableCollection<>`. this kept the CB from updating the text display. Another caveat.Posting this hoping that it will help someone out since these things are not clear in the documentation.
Thanks.
Dude, I'm facing almost the same problem. I'm using a ItemsControl with DataTemplates, one of them have a CheckComboBox which loses its selecteditems, but I don't know why or how. If you could help me, if would be great, I've spent a lot of time trying to figure it out.
Here's the DataTemplate:
`<DataTemplate x:Key="MultiStringTemplate">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.20*"/>
<ColumnDefinition Width="0.25*"/>
<ColumnDefinition Width="0.25*"/>
<ColumnDefinition Width="0.35*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right">
<TextBlock Text="{Binding Prompt}" />
</Label>
<xctk:CheckComboBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" HorizontalAlignment="Left" IsSelectAllActive="True"
ItemsSource="{Binding ValidValues}"
DisplayMemberPath="Label" ValueMemberPath="Value" SelectedMemberPath="Value"
Width="250" SelectedValue="{Binding Value, Mode=TwoWay}" ItemSelectionChanged="CheckComboBox_ItemSelectionChanged"
Closed="Control_Closed" IsEnabled="{Binding Habilitado}" />
</Grid>
</DataTemplate>`
And here the ItemsControl:
<ItemsControl Loaded="ItemsControl_Loaded" Name="Controles"
ItemsSource="{Binding Parametros, Mode=TwoWay}"
ItemTemplateSelector="{StaticResource DataTypeTemplateSelector}"
HorizontalContentAlignment="Center">
<ItemsControl.ItemContainerStyle>
<Style>
<Setter Property="FrameworkElement.Margin" Value="2"/>
</Style>
</ItemsControl.ItemContainerStyle>
</ItemsControl>
Hi, Can you try to apply the proposed workaround in https://github.com/xceedsoftware/wpftoolkit/issues/1589 and see if it helps in your situation ? If not, could you send a complete sample project ? I think some lines are missing in your xctk:CheckComboBox.
Thank you.
Hi, Can you try to apply the proposed workaround in #1589 and see if it helps in your situation ? If not, could you send a complete sample project ? I think some lines are missing in your xctk:CheckComboBox.
Thank you.
Hi, It works 💯 . It was very helpful. Thank you very much.
Hi I have one question Why i can't use SelectedItems in my CheckComboBox But on the Wiki, they use this property It's mistake ?