Hello,
I got an issue with the XamMultiColumnComboEditor control since the the 14.2 service release 2178. This also apply to 15.1 service release 2008.
An invisible UserControl which host a XamMultiColumnComboEditor control raises a "System.NullReferenceException" and crash the application (both VS13 designer & BIN application):
à Infragistics.Controls.Editors.ComboEditorBase`2.XamWebComboEditor_Loaded(Object sender, RoutedEventArgs e) à System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) à System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) à System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) à System.Windows.UIElement.RaiseEvent(RoutedEventArgs e) à System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent) à System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root) à MS.Internal.LoadedOrUnloadedOperation.DoWork() à System.Windows.Media.MediaContext.FireLoadedPendingCallbacks() à System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() à System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget) à System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget) à System.Windows.Media.MediaContext.Resize(ICompositionTarget resizedCompositionTarget) à System.Windows.Interop.HwndTarget.OnResize() à System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam) à System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) à MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) à MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) à System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) à MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) à System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) à MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
Steps to reproduce
1. Define a simple WPF user control "UserControl1" and add the XamMultiColumnComboEditor:
<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ig="http://schemas.infragistics.com/xaml" xmlns:Custom="http://infragistics.com/Windows" x:Class="WpfApplication1.UserControl1" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"> <Grid> <ig:XamMultiColumnComboEditor/> Grid> UserControl>
2. In a window, or page, put that custom control "UserControl1" Inside the second tab - a tab which is not displayed by default
Note: standard WPF TabControl or Infragistics XamTabControl have the same behavior.
<Window xmlns:igWPF="http://schemas.infragistics.com/xaml/wpf" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ig="http://schemas.infragistics.com/xaml" xmlns:local="clr-namespace:WpfApplication1" x:Class="WpfApplication1.MainWindow" Title="MainWindow" Height="350" Width="525"> <Grid> <igWPF:XamTabControl> <igWPF:TabItemEx x:Name="tabItemEx1" Header="tabItemEx1"> <Grid/> igWPF:TabItemEx> <igWPF:TabItemEx x:Name="tabItemEx2" Header="tabItemEx2"> <local:UserControl1 /> igWPF:TabItemEx> igWPF:XamTabControl> Grid> Window>
- Close both documents and open again the window : VS13 designer crashes.
- Close both documents, compile and run : application crashes.
Notes:
- If we move the TabControl to the UserControl : KO, same behavior
- If we move UserControl1 to the first tab (the one which is displayed by default) : OK
Lib. reference: InfragisticsWPF4.Controls.Editors.XamComboEditor - 14.2.20142.2178 (was OK in 14.2.20142.2081)
code snippets
MainWindow:
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:ig="http://schemas.infragistics.com/xaml" xmlns:local="clr-namespace:WpfApplication1" x:Class="WpfApplication1.MainWindow" Title="MainWindow" Height="350" Width="525"> <Grid> <local:UserControl1 HorizontalAlignment="Left" Margin="139,142,0,0" VerticalAlignment="Top"/> Grid> Window>
UserControl1 snippet :
<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:ig="http://schemas.infragistics.com/xaml" x:Class="WpfApplication1.UserControl1" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"> <Grid> <TabControl> <TabItem> <Grid> <CheckBox>DEFAULT ITEMCheckBox> Grid> TabItem> <TabItem> <ig:XamMultiColumnComboEditor /> TabItem> TabControl> Grid> UserControl>
Hello Da Blood,
Thank you for your post.
I have been looking into your issue. Could you please double check if the assemblies that you are using are added from Global Assembly Cache(GAC) of Visual Studio. You can read more details about it from following link: https://msdn.microsoft.com/en-us/library/yf1d93sz(v=vs.110).aspx
Currently if you have a trial account you would not be able to work with the designer. If you want to be able to work with the designer you would have to insert the key, that you have received when you purchased our product into the installer.
Please let me know if you need any further assistance on the matter.
Hi,
I get the same issue.. Since the latest 14.2 update I get a runtime error on my project. I tried to use the 15.1 version unsucessfully (same error).
"An unhandled exception of type 'System.NullReferenceException' occurred in InfragisticsWPF4.Controls.Editors.XamComboEditor.v15.1.dll"
Note: In my case I just have to add an XamComboEditor component (without any options) to get the exception.
Do you have any idea to fix it ?
Thanks for you help.
hi,
you must to install:- Service release 2183 on version 14.2- Service release 2013 on version 15.1
Service release 2013 on version 15.1 is not available for WPF, only for WinForms. Same issue with SR 2183 for 14.2.
Please find a screenshots of my current Downloads page below:
Thanks for your answer :)
Hello Oliver,
I have been looking into it. It seems that the behavior that you have describe was discussed at the following forum thread: http://es.infragistics.com/community/forums/p/95977/474135.aspx#474135.
Yes it's the same issue. Do you know when the fix will be available ?
Thanks,
I have been looking into it. I have created a support ticket for you with number CAS-154877-B6R9V2, in order to be able to get automatically updated when a Service Release containing your fix is available for download.
I am just checking if there is anything else I can do for you.
I've run into this issue as well.Used the auto updater and code started breaking in the weirdest place. Awesome.
So, armed with a decompiler I tried to find out if there's any way to avoid this problem. Seems there isn't:- XamMultiColumnComboEditor has an internal handler for the Loaded event- that handler dereferences the internal property Editor without checking it for null- the Editor property is only ever set in OnApplyTemplate
What this means is that if Loaded fires before OnApplyTemplate is called, the exception is thrown.That is precisely what happens when the control is used in a virtualizing container (like TabControl or Popup).
The best workaround I have found for now is not to use the control