Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
180
Sorting issue on XamGrid
posted

Hello,

I use xamGrid and MultipleColumnSorting but I got an exception when sort some colum on my XamGrid.  Some column works fine but some colum not. I use a custom sort on each Column 

My version is 16.2

Sample for one of my Column

<!--region Icon -->
                <ig:TemplateColumn Key="EquipmentType" HeaderText=" " MinimumWidth="5" Width="45" IsFilterable="False" IsReadOnly="True"
                                   ItemTemplate="{StaticResource EquipmentIconTemplate}"
                                   AllowToolTips="Always" 
                                   IsSortable="True"
                                    SortComparer="{StaticResource StringWithIndexComparer}" 
                                   ToolTipStyle="{StaticResource CustomTooltipStyle}" 
                                   ToolTipContentTemplate="{StaticResource IconTooltipTemplate}">
                </ig:TemplateColumn>
<!-- endregion Icon-->

Does it possible to override/replace MutliSortComparer to be able to have details on issue (breakpoint ?)

Thanks

Exception Stack trace

System.ArgumentException: Unable to sort because the IComparer.Compare() method returns inconsistent results. Either a value does not compare equal to itself, or one value repeatedly compared to another value yields different results. IComparer: 'Infragistics.MultiSortComparer`1[SET.SYD.Client.WorkItems.MainViews.Electrical.MainPanel.FunctionnalView.LNodeDataModel]'.
at System.Collections.Generic.IntrospectiveSortUtilities.ThrowOrIgnoreBadComparer(Object comparer)
at System.Array.SorterObjectArray.IntrospectiveSort(Int32 left, Int32 length)
at System.Array.Sort(Array keys, Array items, Int32 index, Int32 length, IComparer comparer)
at System.Collections.ArrayList.Sort(Int32 index, Int32 count, IComparer comparer)
at System.Windows.Data.ListCollectionView.PrepareLocalArray()
at System.Windows.Data.ListCollectionView.RefreshOverride()
at System.Windows.Data.CollectionView.RefreshInternal()
at System.Windows.Data.CollectionView.EndDefer()
at System.Windows.Data.CollectionView.DeferHelper.Dispose()
at Infragistics.DataManager`1.ResolveFilteredSortedPagedDataSource()
at Infragistics.DataManagerBase.InvalidateSortedFilterdDataSource()
at Infragistics.DataManager`1.ClearCachedDataSource(Boolean invalidateTotalRowCount)
at Infragistics.Controls.Grids.RowsManager.InvalidateSort()
at Infragistics.Controls.Grids.RowsManager.OnColumnLayoutPropertyChanged(ColumnLayout layout, String propertyName)
at Infragistics.Controls.Grids.ColumnLayout.OnPropertyChanged(String propertyName)
at System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
at Infragistics.DependencyObjectNotifier.OnPropertyChanged(String propertyName)
at Infragistics.Controls.Grids.Column.SetSortedColumnState(SortDirection state, Boolean multipleColumnSort)
at Infragistics.Controls.Grids.ColumnCommandBase.Execute(Object parameter)
at Infragistics.Controls.CommandSource.Execute(ICommandTarget target, Boolean canExecute)
at Infragistics.Controls.CommandSource.LookForCommandTarget(FrameworkElement parent, Boolean execute, ICommand command)
at Infragistics.Controls.CommandSource.InvokeCommand(Boolean execute)
at Infragistics.Controls.CommandSource.EventFired(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at Infragistics.Controls.Grids.Primitives.SimpleClickableContainer.OnSimpleClick()
at Infragistics.Controls.Grids.Primitives.SimpleClickableContainer.OnMouseLeftButtonUp(MouseButtonEventArgs e)
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.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
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.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at TSF.Workbench.Generic.EntryPoint.Main() in

  • 25665
    Offline posted

    Hello Estimbre,

    Thank you for contacting Infragistics!

    The best way for us to assist you is if you provide a small isolated sample that we can run and use for debugging locally. If you are unable able to provide an isolated sample I may be able to give suggestions if you provide the code for your page.

    If you want to look at this yourself you can download and build the source code and investigate the exception. You can download the source using the following steps:

    1) Go to https://www.infragistics.com/my-account/keys-and-downloads
    2) Click on the key for the version you want to download the source code for.
    3) Click on the Source Code tab.
    4) Download the source code of the product you are using.