I am getting a strange error occurring intermittently with a xamDataGrid in WPF. The stack trace is as follows. Please advise as to what may be causing this issue. I presume it is something to with the scroll manager inside the xamDataGrid?
System.OverflowException: Negating the minimum value of a twos complement number is invalid. at System.Math.AbsHelper(Int32 value) at Infragistics.Windows.Selection.SelectionStrategyBase.AutoScrollManager.Initialize() at Infragistics.Windows.Selection.SelectionStrategyBase.AutoScrollManager..ctor(SelectionStrategyBase selectionStrategy, AutoScrollInfo autoScrollInfo, MouseEventArgs mouseEventArgs, Boolean directionIsVertical) at Infragistics.Windows.Selection.SelectionStrategyBase.ManageTimers(MouseEventArgs mouseEventArgs) at Infragistics.Windows.Selection.SelectionStrategySingle.OnMouseMove(ISelectableItem item, MouseEventArgs e) at Infragistics.Windows.Selection.SelectionController.OnMouseMove(MouseEventArgs e) at Infragistics.Windows.Controls.IGControlBase.OnMouseMove(MouseEventArgs e) at Infragistics.Windows.DataPresenter.DataPresenterBase.OnMouseMove(MouseEventArgs e) at System.Windows.UIElement.OnMouseMoveThunk(Object sender, MouseEventArgs e) at System.Windows.Input.MouseEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) at System.Windows.Input.MouseDevice.Synchronize() at System.Windows.Input.MouseDevice.OnHitTestInvalidatedAsync(Object sender, EventArgs e) at System.Windows.Input.InputManager.HitTestInvalidatedAsyncCallback(Object arg) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
The XAML is fairly straightforward databound grid:
<igWPF:XamDataGrid Grid.Row="1" x:Name="XamDataGrid" Background="Transparent" GroupByAreaLocation="None" SelectedItemsChanged="XamDataGrid_SelectedItemsChanged">
<igWPF:XamDataGrid.FieldSettings>
<igWPF:FieldSettings AllowEdit="False" CellClickAction="SelectRecord" AllowRecordFiltering="True" FilterOperatorDefaultValue="Contains"/>
</igWPF:XamDataGrid.FieldSettings>
<igWPF:XamDataGrid.FieldLayouts>
<igWPF:FieldLayout>
<igWPF:FieldLayout.Settings>
<igWPF:FieldLayoutSettings AllowAddNew="False" AllowDelete="False" AutoGenerateFields="False" RecordSelectorLocation="None" LabelLocation="Hidden" SelectionTypeRecord="Single" FilterUIType="Default"/>
</igWPF:FieldLayout.Settings>
<igWPF:UnboundField Name="FieldA" BindingPath="FieldA" Label="" Width="Auto"/>
<igWPF:UnboundField BindingPath="FieldB" Label="" Width="*" IsScrollTipField="True">
<igWPF:Field.Settings>
<igWPF:FieldSettings>
<igWPF:FieldSettings.EditorStyle>
<Style TargetType="{x:Type igWPF:XamTextEditor}" BasedOn="{StaticResource {x:Type igWPF:XamTextEditor}}">
<Setter Property="TextWrapping" Value="Wrap"></Setter>
</Style>
</igWPF:FieldSettings.EditorStyle>
</igWPF:FieldSettings>
</igWPF:Field.Settings>
</igWPF:UnboundField>
</igWPF:FieldLayout>
</igWPF:XamDataGrid.FieldLayouts>
</igWPF:XamDataGrid>
I am also seeing this. It is happening for me if you make the height of the grid very small, so that there is not enough room to fully display a row. If you then scroll and select a row the issue occurs. Can the Infragistics developers please fix this? There does not seem to be a workaround to the problem.
-Chris
We are seeing this as well, and I ran into an article that may be related:
http://stackoverflow.com/questions/3614540/cache-key-causes-error-negating-the-minimum-value-of-a-twos-complement-number-i
Is it possible that the grid is doing something similar?
Hello,
I am just checking if you require any further assistance on the matter.
Thank you for your post. I have been looking into your issue and I believe that maybe something wrong happens in the ‘SelectedItemsChanged’ event of the XamDataGrid because I have been trying to reproduce the reported exception without any success. Only the event handler for this event is missing.
Could you please modify the attached sample application(DataGrid_OverflowException.zip) on order to meet exactly your scenario?
Looking forward to hearing from you.
Is anybody able to help with this issue?