SfListView exception when there is grouping and itemsource is changed

Hello,

you changed something which broke whole my application in the latest version where I have sflistview. I cant even describe this error. I have a grouped sflistview and it throw randomly if I change an property of ItemSource object. I think exception below is quite self-explanotory. you make some compare operation whenever itemsource data is changed. this wasnt the behavior in the previous versions. I rolled back to previous version and application works fine. 


{System.InvalidOperationException: Failed to compare two elements in the array. ---> System.ArgumentException: At least one object must implement IComparable.
  at System.Collections.Comparer.Compare (System.Object a, System.Object b) [0x00069] in <fcbf47a04b2e4d90beafbae627e1fca4>:0 
  at System.Collections.Generic.ObjectComparer`1[T].Compare (T x, T y) [0x00000] in <fcbf47a04b2e4d90beafbae627e1fca4>:0 
  at System.Collections.Generic.ArraySortHelper`1[T].InternalBinarySearch (T[] array, System.Int32 index, System.Int32 length, T value, System.Collections.Generic.IComparer`1[T] comparer) [0x00012] in <fcbf47a04b2e4d90beafbae627e1fca4>:0 
  at System.Collections.Generic.ArraySortHelper`1[T].BinarySearch (T[] array, System.Int32 index, System.Int32 length, T value, System.Collections.Generic.IComparer`1[T] comparer) [0x0000b] in <fcbf47a04b2e4d90beafbae627e1fca4>:0 
   --- End of inner exception stack trace ---
  at System.Collections.Generic.ArraySortHelper`1[T].BinarySearch (T[] array, System.Int32 index, System.Int32 length, T value, System.Collections.Generic.IComparer`1[T] comparer) [0x00025] in <fcbf47a04b2e4d90beafbae627e1fca4>:0 
  at System.Array.BinarySearch[T] (T[] array, System.Int32 index, System.Int32 length, T value, System.Collections.Generic.IComparer`1[T] comparer) [0x00044] in <fcbf47a04b2e4d90beafbae627e1fca4>:0 
  at System.Array.BinarySearch[T] (T[] array, T value, System.Collections.Generic.IComparer`1[T] comparer) [0x0000e] in <fcbf47a04b2e4d90beafbae627e1fca4>:0 
  at Syncfusion.DataSource.GroupList.CreateGroup (System.Collections.Generic.List`1[T] groups, System.Int32 level, System.Int32 maxLevel, System.Object item, System.Int32& startIndex, System.Collections.Generic.List`1[System.Object]& changedItems) [0x000e5] in <aa0d944d7db04abc868c91bdf793ac5a>:0 
  at Syncfusion.DataSource.GroupList.InsertItem (System.Collections.Generic.List`1[T] groupResultList, System.Int32 index, System.Object item, System.Int32& startIndex, System.Collections.Generic.List`1[System.Object]& changedItems) [0x0007a] in <aa0d944d7db04abc868c91bdf793ac5a>:0 
  at Syncfusion.DataSource.GroupList.AddItemInGroup (System.Object item, System.Int32 index) [0x00008] in <aa0d944d7db04abc868c91bdf793ac5a>:0 
  at Syncfusion.DataSource.DataSource.NotifyPropertyChangedHandler (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x000ac] in <aa0d944d7db04abc868c91bdf793ac5a>:0 
  at Syncfusion.DataSource.DataSource.OnPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00009] in <aa0d944d7db04abc868c91bdf793ac5a>:0 
  at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)

15 Replies

RS Rawoof Sharief Muthuja Sherif Syncfusion Team April 2, 2018 01:11 PM UTC

Hi Emil, 
 
We have confirmed that the issue with “Argument exception thrown from CreateGroup of DataSource” is a defect and logged a defect report for this. The fix for this issue will be included in our upcoming 2018 Volume 2 main release which is scheduled to be roll out by end of April month and will let you know once the issue has been resolved and included. We will appreciate your patience until then.     
  
Regards,  
Rawoof M. 



JH Jean Hardy April 25, 2018 01:11 PM UTC

Has this issue been solved? I have updated my solution to v16.1.0.37 but still encounter this error on Android. Is there a bypass or something I am missing to solve this?


EM Emil April 25, 2018 09:44 PM UTC

I have just tried the latest version 16.1.0.37 although it says in the release notes that it is fixed. no it isnt fixed. error is still happening. I have already cleared nuget cache, bin, obj folders and rebuilt the app before i installed. please check it again

{System.InvalidOperationException: Failed to compare two elements in the array. ---> System.ArgumentException: At least one object must implement IComparable.
  at System.Collections.Comparer.Compare (System.Object a, System.Object b) [0x00069] in <fcbf47a04b2e4d90beafbae627e1fca4>:0 
  at System.Collections.Generic.ObjectComparer`1[T].Compare (T x, T y) [0x00000] in <fcbf47a04b2e4d90beafbae627e1fca4>:0 
  at System.Collections.Generic.ArraySortHelper`1[T].InternalBinarySearch (T[] array, System.Int32 index, System.Int32 length, T value, System.Collections.Generic.IComparer`1[T] comparer) [0x00012] in <fcbf47a04b2e4d90beafbae627e1fca4>:0 
  at System.Collections.Generic.ArraySortHelper`1[T].BinarySearch (T[] array, System.Int32 index, System.Int32 length, T value, System.Collections.Generic.IComparer`1[T] comparer) [0x0000b] in <fcbf47a04b2e4d90beafbae627e1fca4>:0 
   --- End of inner exception stack trace ---
  at System.Collections.Generic.ArraySortHelper`1[T].BinarySearch (T[] array, System.Int32 index, System.Int32 length, T value, System.Collections.Generic.IComparer`1[T] comparer) [0x00025] in <fcbf47a04b2e4d90beafbae627e1fca4>:0 
  at System.Array.BinarySearch[T] (T[] array, System.Int32 index, System.Int32 length, T value, System.Collections.Generic.IComparer`1[T] comparer) [0x00044] in <fcbf47a04b2e4d90beafbae627e1fca4>:0 
  at System.Array.BinarySearch[T] (T[] array, T value, System.Collections.Generic.IComparer`1[T] comparer) [0x0000e] in <fcbf47a04b2e4d90beafbae627e1fca4>:0 
  at Syncfusion.DataSource.GroupList.CreateGroup (System.Collections.Generic.List`1[T] groups, System.Int32 level, System.Int32 maxLevel, System.Object item, System.Int32& startIndex, System.Collections.Generic.List`1[System.Object]& changedItems) [0x000e5] in <f0ca31670f7b4926b12320021cc11aac>:0 
  at Syncfusion.DataSource.GroupList.InsertItem (System.Collections.Generic.List`1[T] groupResultList, System.Int32 index, System.Object item, System.Int32& startIndex, System.Collections.Generic.List`1[System.Object]& changedItems) [0x0007a] in <f0ca31670f7b4926b12320021cc11aac>:0 
  at Syncfusion.DataSource.GroupList.AddItemInGroup (System.Object item, System.Int32 index) [0x00008] in <f0ca31670f7b4926b12320021cc11aac>:0 
  at Syncfusion.DataSource.DataSource.NotifyPropertyChangedHandler (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x000ac] in <f0ca31670f7b4926b12320021cc11aac>:0 
  at Syncfusion.DataSource.DataSource.OnPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e) [0x00009] in <f0ca31670f7b4926b12320021cc11aac>:0 
  at (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)


EM Emil April 25, 2018 09:49 PM UTC

@Jean Hardy, just use the version 16.1451.0.26, this is the last working version. Dont forget to downgrade dependency libraries also. 


RS Rawoof Sharief Muthuja Sherif Syncfusion Team April 26, 2018 07:38 AM UTC

Hi Emil, 
 
Sorry for the inconvenience. 
 
Due to some technical issues from our side, this fix hasn’t been included in our 2018 Volume 1 SP 2 release. We highly regret for the inconvenience caused. This fix will be included in our 2018 Volume 2 main release which is scheduled to be rolled out by end of next month. We would highly appreciate your patience until then.  
 
Regards, 
Rawoof M. 
 



CH cherry May 10, 2018 03:29 AM UTC

Hi, 

Do you have older version wherein this problem doesn't occur? I tried looking for version 16.1451.0.26 as suggested above but I don't think that version exists. We need to release an app soon so we can't wait for the release of  2018 Volume 2 main release by the end of this month

Thank you.


Best regards,
Cherry


AN Antonio May 10, 2018 12:38 PM UTC

Hello to all,

Currently I have not updated my project due to lack of time at SfListView.

But I had the same problem with the "Original" ListView, after one of the latest updates of Xamarin.Forms.

If the SfListView is implemented on the basis of that it is easy for the problem to derive from this situation.

However I have circumvented the problem, doing so:

listViewTest.IsGroupingEnabled = false;
listViewTest.HasUnevenRows = false;  // If it set

listViewTest.ItemsSource = null;

listViewTest.IsGroupingEnabled = true;
listViewTest.HasUnevenRows = true;.
.
.
.
.
listViewTest.ItemsSource = _NewgroupedCollection; // which contains the "new" data source.


As soon as possible I will make the transaction from ListView to SfListView, in the meantime I hope this solution can be useful to you and is working smoothly with the SfListView.

If I'm wrong, sorry for my intervention in the discussion and I ask the moderators to cancel it, thanks.


EM Emil May 10, 2018 10:02 PM UTC

SfListView  16..0.26 is already working fine. no need a workaround. If you cant find this version Syncfusion nuget source, try default nuget.org source. Syncfusion changed between these 2 in one of the version. I am not sure which one.


CH cherry May 11, 2018 01:25 AM UTC

Hi Emil,
Thank you very much. I've been downloading the dll from Syncfusion directly not from the Nuget. I'll try the nuget library

Best regards, 
Cherrry


RS Rawoof Sharief Muthuja Sherif Syncfusion Team May 11, 2018 04:38 AM UTC

Hi Antonio, 
 
We would like to let you know that the SfListView has the same feature as mentioned by you in the last update. If you want to enable group you can add GroupDescriptor property and you want to enable HasUnEvenRows you need to set the AutoFitMode as height. We have already mentioned this in our UG documentation. Please refer the below link. 

 
Can you please let us know if any issue you are facing while migrating to SfListView? 
 
Regards, 
Rawoof M. 



RS Rawoof Sharief Muthuja Sherif Syncfusion Team May 11, 2018 04:39 AM UTC

Hi Cherry, 

Thanks for the update. You can get the nuget package from the nuget.org source or Syncfusion nuget source as mentioned in the last update by Emil. 

Regards, 
Rawoof M. 



AN Antonio replied to Rawoof Sharief Muthuja Sherif May 11, 2018 09:28 AM UTC

Hi Antonio, 
 
We would like to let you know that the SfListView has the same feature as mentioned by you in the last update. If you want to enable group you can add GroupDescriptor property and you want to enable HasUnEvenRows you need to set the AutoFitMode as height. We have already mentioned this in our UG documentation. Please refer the below link. 

 
Can you please let us know if any issue you are facing while migrating to SfListView? 
 
Regards, 
Rawoof M. 


OK thanks.

Surely I will update you on the transition phase to SfListView

Hello !


RS Rawoof Sharief Muthuja Sherif Syncfusion Team May 14, 2018 03:29 AM UTC

Hi Antonio, 

Thanks for the update. 

Regards, 
Rawoof M. 



AN Andy June 13, 2018 12:49 PM UTC

Hi,

when will the new version be released with the fixed bug?
I use version 16.1.0.37 and as Emil said the bug is alltough included there.

Thank you!

Maria


RS Rawoof Sharief Muthuja Sherif Syncfusion Team June 14, 2018 09:42 AM UTC

Hi Maria, 
 
The reported issue has been fixed and it will be included in our 2018 Volume 2 main release which is scheduled to be roll out by end of June month. We would highly appreciate your patience until then.  
  
Regards, 
Rawoof M. 


Loader.
Up arrow icon