Hi,We were using an UltraWebGrid version 8.2 in our application, where we were using the grouping feature, and it was working fine. In one of our enhancements we've upgraded to version 9.1. When we group for the first time, we do not get any error. However, on grouping for the second time, we are getting the following error: Infragistics.WebUI.UltraWebGrid.UltraGridLayout.GroupByColumnComparer.Compare(Object x, Object y) at System.Array.BinarySearch(Array array, Int32 index, Int32 length, Object value, IComparer comparer)Hi,We were using an UltraWebGrid version 8.2 in our application, where we were using the grouping feature, and it was working fine. In one of our enhancements we've upgraded to version 9.1. When we group for the first time, we do not get any error. However, on grouping for the second time, we are getting the following error: Infragistics.WebUI.UltraWebGrid.UltraGridLayout.GroupByColumnComparer.Compare(Object x, Object y) at System.Array.BinarySearch(Array array, Int32 index, Int32 length, Object value, IComparer comparer)Kindly help us with the same.Thanks in advance.Regards,RimiThanks in advance.Regards,Rimi
Hi Rimi,
To investigate this issue further, please provide me the full error message which you are getting while grouping on second time.
Let me know if you have any questions with this matter.
NehaDeveloper Support EngineerInfragisticswww.infragistics.com/support
Here you go, Neha:
Normal 0 false false false EN-GB X-NONE X-NONE
at System.Web.HttpAsyncResult.End() at System.Web.UI.Page.AspCompatEndProcessRequest(IAsyncResult result) at ASP.ngrid_xml_grid_page_aspx.EndProcessRequest(IAsyncResult ar) at System.Web.HttpApplication.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar)--- InnerException : System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.InvalidOperationException: Failed to compare two elements in the array. ---> System.NullReferenceException: Object reference not set to an instance of an object. at Infragistics.WebUI.UltraWebGrid.UltraGridLayout.GroupByColumnComparer.Compare(Object x, Object y) at System.Array.BinarySearch(Array array, Int32 index, Int32 length, Object value, IComparer comparer) --- End of inner exception stack trace --- at System.Array.BinarySearch(Array array, Int32 index, Int32 length, Object value, IComparer comparer) at System.Collections.SortedList.IndexOfKey(Object key) at System.Collections.SortedList.get_Item(Object key) at Infragistics.WebUI.UltraWebGrid.UltraGridLayout.RegisterGroupByColumn(UltraGridColumn groupedColumn) at Infragistics.WebUI.UltraWebGrid.UltraWebGrid.GroupRows(RowsCollection rows, UltraGridColumn column) at Infragistics.WebUI.UltraWebGrid.UltraWebGrid.SortGroupRows(RowsCollection rows) at Infragistics.WebUI.UltraWebGrid.UltraWebGrid.PerformGroupRows() at Infragistics.WebUI.UltraWebGrid.UltraWebGrid.PreRenderGrid() at Infragistics.WebUI.UltraWebGrid.UltraWebGrid.OnPreRender(EventArgs e) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace --- at System.Web.UI.Page.HandleError(Exception e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.Util.AspCompatApplicationStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Thanks,
Rimi
I have used the above already, but to no avail. I've even tried by setting IsGroupByColumn to false. But still getting the same issue.
Hello Rimi,
I am just checking about the progress of this issue.
Let me know if you need any further assistance.
Hi
Was this ever resolved? It still seems to be an issue in 2010.2.
The issue can be solved by the provided suggestion: reseting the columns, rows and bands. UltraWebGrid1.ResetBands();UltraWebGrid1.ResetColumns();UltraWebGrid1.ResetRows(); Most of the clients who experienced this issue were not able to resolve this from the first time because they used UltraWebGrid1.Rows.Clear(); UltraWebGrid1.Columns.Clear(); UltraWebGrid1.Clear(); You needed to comment/remove the above lines becauseby invoking them you force the grid to remove all data from the grid and removes all columns.After these actions , all columns should be added manually and all rows should be filled before DataBind. Please let me know if you need further assistance regarding this.
I had the same issue when I migrated from version 8.1 to 10.3.. the above code didn't work.
The above issue was resolved by adding the below line before binding the database.
grid.Reset();