Hello,
We’re using a XamComboEditor in .NET advantage 13.1 and are upgrading to Ultimate 15.1.
The ComboEditor crashes our application after this upgrade.
We used to have a custom filter in our ComboEditor:
<editors:XamComboEditor x:Name="comboEditor" AutoComplete="False" AllowFiltering="True"
Style="{StaticResource OurStyle}"
Width="180" Height="25" MaxHeight="25" MinHeight="25" Margin="15,0,0,0"
ItemsSource="{Binding OutItems}"
DisplayMemberPath="Name"
SelectedItem="{Binding SelectedItem}" >
<editors:XamComboEditor.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" >
<TextBlock Text="{Binding Path=Name}" Margin="5" Foreground="{DynamicResource OurForeground}"/>
</StackPanel>
</DataTemplate>
</editors:XamComboEditor.ItemTemplate>
<editors:XamComboEditor.CustomItemsFilter>
<editors:ItemsFilter>
<editors:ItemsFilter.Conditions>
<infragistics:ComparisonCondition Operator="Contains" />
</editors:ItemsFilter.Conditions>
</editors:ItemsFilter>
</editors:XamComboEditor.CustomItemsFilter>
</editors:XamComboEditor>
This control does not compile in 15.1. because of the “CustomItemFilter” object.
I changed the CustomItemFilter to ItemFilters and here’s the new ComboEditor:
<editors:XamComboEditor.ItemFilters>
<editors:ComboItemFilter>
<editors:ComboItemFilter.Conditions>
</editors:ComboItemFilter.Conditions>
</editors:ComboItemFilter>
</editors:XamComboEditor.ItemFilters>
That’s working, but our style is now causing runtime errors.
I get a NullReferenceException with the following stack (Will provide the complete stack if needed)
on. System.NullReferenceException: Object reference not set to an instance of an object.
at Infragistics.Controls.Editors.ComboEditorBase`2.UpdatePositionStates()
at Infragistics.Controls.Editors.Primitives.ItemsPanelBase`2.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
The source of the exception seems to be our MouseOver Visualstate (can provide the entire style if needed):
<VisualState x:Name="MouseOver">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Bd" Storyboard.TargetProperty="Fill">
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ComboEditorItemHoverBackgroundFillBrush}"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="Bd" Storyboard.TargetProperty="Stroke">
</Storyboard>
</VisualState>
Is the change to the XAML object correct? Is there another object tag which is correct ?
If my change is correct, what may be causing the crash ?
Thanks.
Hello mdperini,
Thank you for your post!
I have been investigating into this issue you are seeing, but as of yet, I have not been able to reproduce this behavior you are seeing with the style snippets that you have provided. Being that this null reference exception appears to be getting triggered in your style for XamComboEditor and with regards to your MouseOver VisualState, would it possible for you to please include full style that you are using for you XamComboEditor, along with the implementation and firing mechanism (trigger, code-behind, etc) of your VisualState?
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Just checking in, did you still require assistance on this matter?
Thank you Andrew,
The issue is now resolved.
Michael Perini
Citigroup
i have a similar issue concerning the XamComboEditor; i just made an update 15.1 -> 15.2 and now the older views that contain an old Comboeditor crash (null reference).
Perhaps you can tell me which solution worked for you?
Th
Thorben,
Please provide a call stack for the NullReferenceException.
Hello Alan,
right now i was able to solve this by myself. After using the process-viewer i discovered a reference to a dll of 15.1; after removing this reference all views seem to work as planned.
So i think this was the cause that the "old" parts crashed.
Sincerely
I am happy to hear that this is resolved.
My guess is that you had an assembly that was still referencing the older volume and when the type was passed to a variable in another assembly referencing the newer version that it resulted in a variable being null (possibly if using the as keyword in C# for something that you never expect to be null) and that caused the NullReferenceException. This is only a theory, I would need to actually see the issue to know if this was the scenario or not.