Bug Report T316151
Visible to All Users

Grid Item - Exception is raised on sorting a Year column by clicking the column header

created 9 years ago

Exception is raised on sorting a Year column by clicking the column header

Comments (3)

    Constant, is this error the same error that we get when sorting a grid by a long value?
    Thanks,
    Todd
    Exception:
    System.InvalidOperationException: Failed to compare two elements in the array. ---> System.InvalidCastException: Specified cast is not valid.
      at DevExpress.Data.Helpers.ExpressiveSortHelpers.GetCompareRowCellInfoTypedCompareHelper.NullableCombarableMaker.Impl`1.<>c__DisplayClass37.<Make>b__34(CondencedAndSourceIndicesPair row1, CondencedAndSourceIndicesPair row2, Object v1, Object v2)
      at DevExpress.Data.Helpers.ExpressiveSortHelpers.CellComparerBuilder.Impl`1.<>c__DisplayClass4c.<Build>b__49(CondencedAndSourceIndicesPair r1, CondencedAndSourceIndicesPair r2)
      at DevExpress.Data.Helpers.ExpressiveSortHelpers.<>c__DisplayClassb.<MakeRowsCompare>b__3(CondencedAndSourceIndicesPair r1, CondencedAndSourceIndicesPair r2)
      at DevExpress.Data.Helpers.ExpressiveSortHelpers.ComparisonComparer`1.Compare(T x, T y)
      at System.Collections.Generic.ArraySortHelper`1.SwapIfGreater(T[] keys, IComparer`1 comparer, Int32 a, Int32 b)
      at System.Collections.Generic.ArraySortHelper`1.IntroSort(T[] keys, Int32 lo, Int32 hi, Int32 depthLimit, IComparer`1 comparer)
      at System.Collections.Generic.ArraySortHelper`1.Sort(T[] keys, Int32 index, Int32 length, IComparer`1 comparer)
      --- End of inner exception stack trace ---
      at System.Collections.Generic.ArraySortHelper`1.Sort(T[] keys, Int32 index, Int32 length, IComparer`1 comparer)
      at System.Array.Sort[T](T[] array, Int32 index, Int32 length, IComparer`1 comparer)
      at System.Collections.Generic.List`1.Sort(Int32 index, Int32 count, IComparer`1 comparer)
      at DevExpress.Data.VisibleListSourceRowCollection.SortRows(DataColumnSortInfo[] sortInfo)
      at DevExpress.Data.DataController.DoSortRows()
      at DevExpress.Data.DataController.OnRefresh(Boolean useRowsKeeper)
      at DevExpress.Data.DataController.DoRefreshCore(Boolean useRowsKeeper)
      at DevExpress.Data.DataController.DoRefresh(Boolean useRowsKeeper)
      at DevExpress.Data.CurrencyDataController.DoRefresh(Boolean useRowsKeeper)
      at DevExpress.Data.DataController.DoSortGroupRefresh()
      at DevExpress.Data.DataController.EndUpdateCore(Boolean sortUpdate)
      at DevExpress.XtraGrid.Views.Base.ColumnView.EndDataUpdateCore(Boolean sortOnly)
      at DevExpress.XtraGrid.Views.Base.ColumnView.DoMouseSortColumn(GridColumn column, Keys key)
      at DevExpress.XtraGrid.Views.Grid.Handler.GridHandler.DoMouseSortColumn(GridColumn column, Keys key)
      at DevExpress.XtraGrid.Views.Grid.Handler.GridHandler.DoClickAction(BaseHitInfo hitInfo)
      at DevExpress.XtraGrid.Views.Base.ViewInfo.BaseSelectionInfo.CheckMouseUp(BaseHitInfo hitInfo)
      at DevExpress.XtraGrid.Views.Grid.Handler.GridHandler.OnMouseUp(MouseEventArgs ev)
      at DevExpress.Utils.Controls.BaseHandler.ProcessEvent(EventType etype, Object args)
      at DevExpress.XtraGrid.Views.Base.Handler.BaseViewHandler.ProcessEvent(EventType etype, Object args)
      at DevExpress.XtraGrid.GridControl.OnMouseUp(MouseEventArgs ev)
      at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
      at System.Windows.Forms.Control.WndProc(Message& m)
      at DevExpress.XtraEditors.Container.EditorContainer.WndProc(Message& m)
      at DevExpress.XtraGrid.GridControl.WndProc(Message& m)
      at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
      at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
      at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

    DevExpress Support Team 9 years ago

      Hi Todd,

      Yes, these errors appear to be caused by the same issue. We will continue working on a permanent solution and will keep you informed of our progress.

        Thanks Alex!

        Answers approved by DevExpress Support

        created 9 years ago

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

          Comments (2)

            Thank you, this fixed the exception we were seeing.

            DevExpress Support Team 9 years ago

              You are welcome Todd,
              We are happy to hear that you have resolved this issue.

              Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

              Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.