If I set the LabelLocation="Default", no exception is thrown.
Hi,
I'm getting the same behavior here too. It seems that the exception occurs when LabelLocation is set to Hidden and AutoFit is set to true. If I change either one to the default value there isn't an exception.
Here is my stack trace:
System.IndexOutOfRangeException was unhandled Message="Der Index war außerhalb des Arraybereichs." Source="Infragistics3.Wpf.DataPresenter.v7.2" StackTrace: bei Infragistics.Windows.DataPresenter.DataPresenterBase.a(FrameworkElement A_0, Field A_1, Boolean A_2, Boolean A_3, Double A_4) bei Infragistics.Windows.DataPresenter.DataPresenterBase.a(FrameworkElement A_0, Field A_1, Boolean A_2, Boolean A_3, Boolean A_4, Double A_5, Double A_6) bei Infragistics.Windows.DataPresenter.DataPresenterBase.a(FrameworkElement A_0, Field A_1, Boolean A_2, Boolean A_3, Boolean A_4, Double A_5, Boolean A_6) bei Infragistics.Windows.DataPresenter.DataPresenterBase.Infragistics.Windows.Resizing.IResizeHost.Resize(FrameworkElement resizableItem, Boolean resizeInXAxis, Double delta) bei Infragistics.Windows.Resizing.ResizeController.a(MouseDevice A_0) bei Infragistics.Windows.Resizing.ResizeController.a(Object A_0, MouseButtonEventArgs A_1) bei System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) bei System.Windows.UIElement.ReRaiseEventAs(RoutedEventArgs args, RoutedEvent newEvent) bei System.Windows.UIElement.OnPreviewMouseUpThunk(Object sender, MouseButtonEventArgs e) bei System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) bei System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) bei System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) bei System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) bei System.Windows.UIElement.RaiseEventImpl(RoutedEventArgs args) bei System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted) bei System.Windows.Input.InputManager.ProcessStagingArea() bei System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) bei System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) bei System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel) bei System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) bei System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) bei System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) bei System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) bei System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) bei MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) bei MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) bei System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) bei System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) bei System.Windows.Threading.Dispatcher.Run() bei System.Windows.Application.RunInternal(Window window) bei System.Windows.Application.Run(Window window) bei System.Windows.Application.Run() bei Helon.Shell.App.Main() in D:\Projekte\Helon2\Source\Helon.Shell\obj\Debug\App.g.cs:Zeile 0. bei System.AppDomain._nExecuteAssembly(Assembly assembly, String[ args) bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[ args) bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() bei System.Threading.ThreadHelper.ThreadStart_Context(Object state) bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) bei System.Threading.ThreadHelper.ThreadStart() InnerException:
I was able to duplicate the problem when I set AutoFit to true and LabelLocation to 'Hidden'. I'll enter a bug into our system so it gets fixed.
Until it gets fixed, here is a workaround. Leave LabelLocation set to its default value and place the following style in the XamDataGrid's Resources collection:
<Style TargetType="{x:Type igDP:DataRecordPresenter}">
<Style.Triggers>
<Trigger Property="IsHeaderRecord" Value="True">
<Setter Property="Height" Value="0"/>
</Trigger>
</Style>