-
Notifications
You must be signed in to change notification settings - Fork 882
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NullReferenceException when SelectAll for collection of value types #1787
Comments
Hi, How exactly do you define the CheckComboBox items to use enums ? Thank you |
You need to bind Code line public void SelectAll()
{
var currentSelectedItems = new List<object>( this.SelectedItems as IEnumerable<object> ); changed to public void SelectAll()
{
var currentSelectedItems = new List<object>( this.SelectedItems.Cast<object>() );` |
Hi @darxis, I can reproduce the issue, but I'm evaluating the need for it. Thank you |
Hi @XceedBoucherS, thanks for your reply. What do you mean PS: I am using something like this: <xctk:CheckComboBox ItemsSource="{Binding MyItems}" SelectedItemsOverride="{Binding MySelectedItems}" IsSelectAllActive="True" /> |
Also I noticed this bug was not present in WpfToolkit v3.8.2, but I wanted to upgrade to v4.6.1 and I discovered this bug exists in v.4.6.1. |
Thank you @darxis for the explanations. |
A
NullReferenceException
is thrown when theSelectAll/UnselectAll
methods withinSelectAllSelector
are called and theSelectedItems
collection items type is a value type.For example you could have
CheckComboBox
with enums as items. When clicking theSelect all
checkbox aNullReferenceException
is thrown.The text was updated successfully, but these errors were encountered: