- Home
- Forum
- Xamarin.Forms
- Data Grid Issue with grouped column
Data Grid Issue with grouped column
i format it i little bit better....
08-05 16:09:30.853 I/MonoDroid(24298): UNHANDLED EXCEPTION:
08-05 16:09:30.902 I/MonoDroid(24298): System.NullReferenceException: Object reference not set to an instance of an object.
08-05 16:09:30.902 I/MonoDroid(24298): at Syncfusion.SfDataGrid.XForms.SfDataGrid+<>c__DisplayClass327_0.<OnItemsSourceChanged>b__0 (Syncfusion.SfDataGrid.XForms.GroupColumnDescription col) [0x00016] in <3ea70b4f0fbc450a8acf949b35d96088>:0
08-05 16:09:30.902 I/MonoDroid(24298): at System.Linq.Enumerable+WhereEnumerableIterator`1[TSource].ToList () [0x0001b] in <cc41d889a5b24501ae882a5cc55746dd>:0
08-05 16:09:30.902 I/MonoDroid(24298): at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0001f] in <cc41d889a5b24501ae882a5cc55746dd>:0
08-05 16:09:30.902 I/MonoDroid(24298): at Syncfusion.SfDataGrid.XForms.SfDataGrid.OnItemsSourceChanged (Xamarin.Forms.BindableObject bindable, System.Object oldValue, System.Object newValue) [0x000a8] in <3ea70b4f0fbc450a8acf949b35d96088>:0
08-05 16:09:30.902 I/MonoDroid(24298): at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.BindableObject+SetValueFlags attributes, System.Boolean silent) [0x00108] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindableObject.cs:592
08-05 16:09:30.902 I/MonoDroid(24298): at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.BindableObject+SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindableObject.cs:386
08-05 16:09:30.902 I/MonoDroid(24298): at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x001f9] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindingExpression.cs:173
08-05 16:09:30.902 I/MonoDroid(24298): at Xamarin.Forms.BindingExpression.Apply (System.Boolean fromTarget) [0x0003e] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindingExpression.cs:55
08-05 16:09:30.902 I/MonoDroid(24298): at Xamarin.Forms.BindingExpression+BindingExpressionPart.<PropertyChanged>b__47_0 () [0x00000] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindingExpression.cs:539
08-05 16:09:30.902 I/MonoDroid(24298): at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <d855bac285f44dda8a0d8510b679b1e2>:0
08-05 16:09:30.902 I/MonoDroid(24298): at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <d855bac285f44dda8a0d8510b679b1e2>:0
08-05 16:09:30.902 I/MonoDroid(24298): at (wrapper dynamic-method) System.Object:c703595d-c7f6-4af2-87dc-25e5fee83ea6 (intptr,intptr)
08-05 16:09:30.929 W/art (24298): JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable
08-05 16:09:30.936 D/Mono (24298): DllImport searching in: '__Internal' ('(null)').
08-05 16:09:30.936 D/Mono (24298): Searching for 'java_interop_jnienv_throw'.
08-05 16:09:30.936 D/Mono (24298): Probing 'java_interop_jnienv_throw'.
08-05 16:09:30.936 D/Mono (24298): Found as 'java_interop_jnienv_throw'.
Thanks for contacting Syncfusion Support. We are checking the reported issue based on the stack trace you have provided and were not able to replicate the issue. Could you please share the proper replication details regarding the features you have included , replication procedure, the operation you are performing when the crash is produced etc so that we can help you better and overcome your issue.
Regards,
Vimal Prabhu
the app breaks when i do this for the 2 time:
Data= new ObservableCollection<view_data>(currentData.Data.Where(t => t.TYPE.ToUpper() == "PIPPO"));
and my datagrid is
<syncfusion:SfDataGrid Grid.Row="3" Grid.Column="0" x:Name="dg" ColumnSizer="Star" AutoGenerateColumns="False" VerticalOptions="FillAndExpand" HeightRequest="400"
ItemsSource="{Binding Data}" AllowGroupExpandCollapse="False" AutoExpandGroups="True" ScrollingMode="PixelLine" >
<syncfusion:SfDataGrid.GroupColumnDescriptions>
<syncfusion:GroupColumnDescription ColumnName="A_TYPE" />
</syncfusion:SfDataGrid.GroupColumnDescriptions>
Thank you for the update. We have prepared a sample based on the sample codes you have provided and recreated a crash with same stack trace as yours. Could you please download the sample from the below link and conform us whether this is the exact scenario of the crash in your application ? Crash replication procedure for the sample in below link:
1. Restore the nugets or add Syncfusion refrences and run the sample. (Initially the Grid loads with Itemsource as Collection_One with a property from Collection_One as the GroupedColumn. This renders the grid without any problem.)
If your replication of the issue or your scenario may differ, we kindly request you to modify the above sample to replicate the issue along with clear replication procedure.
Regards,
Vimal Prabhu
hi,
yes i have the same error!
how can i fix it?
thanks
hi,
after update now i have this error:
SortColumnDescription already exist in SfDataGrid.SortColumnDescriptions
quick fix:
this.dg.SortColumnDescriptions.Clear();
but it is only a workaround ;)
reported issue is still occurring using latest version. please check it again. exact same scenario as OP reported causes this exception when raising changes on ObservableCollection second time or reordering using drag and drop feature. Please test it with drag and drop on grouped data and raise changed on model.
@alberto: where do you do this exactly? this.dg.SortColumnDescriptions.Clear();
I am using mvvm and i cant figure it out. if i use it. it returns me other error telling as below. probably because of I am getting this exception while doing drag and drop.
09-28 02:03:31.989 I/MonoDroid(17490): UNHANDLED EXCEPTION:
09-28 02:03:32.017 I/MonoDroid(17490): System.NullReferenceException: Object reference not set to an instance of an object.
09-28 02:03:32.017 I/MonoDroid(17490): at Syncfusion.SfDataGrid.XForms.GridRowDragDropController.EndDragging () [0x001b4] in
09-28 02:03:32.017 I/MonoDroid(17490): at Syncfusion.SfDataGrid.XForms.GridRowDragDropController.OnDragEnded () [0x00008] in
09-28 02:03:32.017 I/MonoDroid(17490): at Syncfusion.SfDataGrid.XForms.Droid.GridCellBaseRenderer.HandleTouchForRowDragAndDrop (Android.Views.MotionEvent e) [0x000d4] in
This can be easily reproduced using drag and drop feature on group HEADER. You should do it 2 times. first time it works for some reason but 2nd time doing it throws this exception. here is my datagrid
ItemsSource="{Binding WorkoutItems}" AutoGenerateColumns="False" AllowGroupExpandCollapse="True" AllowSorting="False" IsEnabled="True" ColumnSizer="Star" AllowSwiping="False" AllowDraggingRow="True" AllowDraggingColumn="False" GridTapped="dataGrid_GridTapped" SelectionMode="None" QueryRowHeight = "DataGrid_QueryRowHeight" VerticalOptions="FillAndExpand" > WinPhone="30" iOS="20" x:TypeArguments="x:Double" /> HeaderText="{resx:Translate Items,IsUpper=True}" MappingName="DisplayOrder"> Tablet="15" x:TypeArguments="x:Double" />
Hi Emil,Sorry for the inconvenience caused.We have checked your query and we were able to reproduce the reported issue on our last release assemblies. However, the issue not reproduced in both our current source and the last release source. So, the issue might be in the shipped assemblies. Hence, the reported issue will be fixed in our upcoming 2017 Vol 3 SP2 release assemblies which will roll out by tomorrow. We appreciate your patience until then.Regards,Divakar.
Hi Divakar,
I just updated to 2017 Vol 3 SP2 and cleared nuget cache, bin, obj, temp folders, rebuilt my application but Issue is not resolved. It is still crashing on second attempt of reordering SfDatagrid row. Can you please check ?
Exception message:
09-29 15:09:06.791 I/MonoDroid(21886): UNHANDLED EXCEPTION:
09-29 15:09:06.804 I/MonoDroid(21886): System.InvalidOperationException: SortColumnDescription already exist in SfDataGrid.SortColumnDescriptions
09-29 15:09:06.804 I/MonoDroid(21886): at Syncfusion.SfDataGrid.XForms.SfDataGrid.InitialSort () [0x000eb] in
09-29 15:09:06.804 I/MonoDroid(21886): at Syncfusion.SfDataGrid.XForms.SfDataGrid.DeferRefresh () [0x0002c] in
09-29 15:09:06.804 I/MonoDroid(21886): at Syncfusion.SfDataGrid.XForms.SfDataGrid.SetSourceList (System.Object source) [0x0000d] in
09-29 15:09:06.804 I/MonoDroid(21886): at Syncfusion.SfDataGrid.XForms.SfDataGrid.OnItemsSourceChanged (Xamarin.Forms.BindableObject bindable, System.Object oldValue, System.Object newValue) [0x0026e] in
09-29 15:09:06.804 I/MonoDroid(21886): at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.BindableObject+SetValueFlags attributes, System.Boolean silent) [0x00108] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindableObject.cs:592
09-29 15:09:06.804 I/MonoDroid(21886): at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.BindableObject+SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindableObject.cs:386
09-29 15:09:06.804 I/MonoDroid(21886): at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x001f9] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindingExpression.cs:173
09-29 15:09:06.804 I/MonoDroid(21886): at Xamarin.Forms.BindingExpression.Apply (System.Boolean fromTarget) [0x0003e] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindingExpression.cs:55
09-29 15:09:06.804 I/MonoDroid(21886): at Xamarin.Forms.BindingExpression+BindingExpressionPart.
09-29 15:09:06.804 I/MonoDroid(21886): at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in
09-29 15:09:06.804 I/MonoDroid(21886): at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in
09-29 15:09:06.804 I/MonoDroid(21886): at (wrapper dynamic-method) System.Object:5abf7f4c-5675-45b2-9b3a-29809e2d3f11 (intptr,intptr)
thanks,
Emil
hi ,sorry for delay.
my 'stupid' fix is this
private void PkCountry_SelectedIndexChanged(object sender, EventArgs e)
{
this.dgBrand.SortColumnDescriptions.Clear();
}
The same error can be reproduced (on Syncfusion version 15.3.0.33 as well as on a couple of older versions) by having a grouped grid definition and assigning a data source to that grid twice in code. Syncfusion code inserts a sort column definition automatically on any grid that has a group definition every time the data source is refreshed. This is an internal bug.
Thank you for the bypass suggestion. Does Syncfusion support have an alternate bypass ? I assume we need to live with this until the October end update earliest.
latest version is totally buggy. I could produce minimum 3 different exceptions as I reported with separate tickets (see my other tickets). I dont know how we can live with this. This feature is the most important feature I am using SfDatagrid over any other Listview.
hi ,sorry for delay.
my 'stupid' fix is this
private void PkCountry_SelectedIndexChanged(object sender, EventArgs e)
{
this.dgBrand.SortColumnDescriptions.Clear();
}
Hi Alberto,
which event are you using? is it SelectionChanged event? I cant find any SelectedIndexChanged exposed on sfDatagrid?
thanks,
Emil
We have checked for issues in the latest 2017 Volume 3 SP 2 dlls , in DragAndDrop along with Grouping enabled and we were not able to replicate any issue, crashes when row was dragged from one group to another and when group was dragged and dropped from one position to the other. We have also checked with clearing group column descriptions and changing itemsource in runtime and neither of which caused an exception. Please refer to the video recording of the same below.
Video Link : http://www.syncfusion.com/downloads/support/forum/131966/ze/ScreenCapture_02-Oct-17_2.43.59_PM1320485044
Sample Link : http://www.syncfusion.com/downloads/support/forum/131966/ze/Forms-1548677286
Please provide us with clear replication details on how to replicate the issue or please share with us the sample that can replicate the issue, without which we cannot proceed further. At moment we are still unclear on what your trying to achieve and when this exception is caused. Please revert us with the below details so that we can help you.
- What is your requirement and what hurdle are you facing in achieving it?
- When does this error occur ? What operations are you performing in sequence?
- What are all the features enabled in SfDataGrid ?
- Sample code or the sample itself replicating the issue
- Or modify our sample attached below so that the issue can be replicated .
Regards,
Vimal Prabhu
Dear Support team,
In your documentation on link below; it is claimed these 3 points below. see my comments with bold. I attach modified sample for repro.
https://help.syncfusion.com/xamarin/sfdatagrid/rowdraganddrop#dragging-scenarios
- Records can be reordered to any position with auto scrolling. this works fine
- Groups position can be reordered using drag and drop. But no groups can be added inside other groups. this doesnt work unless you want to do it in memory and you should state it that you can only order it in memory but cannot commit changes to the underlying data
- Data rows can be reordered within the same group or into the other groups as well. this doesnt work unless you want to do it in memory and you should state it that you can only order it in memory but cannot commit changes to the underlying data
Attachment: Forms_e5abd2bd.7z
hi all,
so finally how can fix this
System.InvalidOperationException: SortColumnDescription already exist in SfDataGrid.SortColumnDescriptions
?
the problem is that in yor example you click a button in order to SortColumnDescriptions, but i have to do in the viewmodel, or each time i update the collection.
thanks
hi,
i'm not adding a new sort column, i'm just updating the ObservableCollection to a grid with GroupColumnDescriptions.
The problem is that i'm using viewmodel so i can't call clear command .
can you help me.. so i'd like to call clear command before update of collection
i can't understand why,
i'm using your same version and i get always this
10-27 12:36:23.830 I/MonoDroid(26172): System.InvalidOperationException: SortColumnDescription already exist in SfDataGrid.SortColumnDescriptions
10-27 12:36:23.830 I/MonoDroid(26172): at Syncfusion.SfDataGrid.XForms.SfDataGrid.InitialSort () [0x000eb] in
10-27 12:36:23.830 I/MonoDroid(26172): at Syncfusion.SfDataGrid.XForms.SfDataGrid.DeferRefresh () [0x0002c] in
10-27 12:36:23.830 I/MonoDroid(26172): at Syncfusion.SfDataGrid.XForms.SfDataGrid.SetSourceList (System.Object source) [0x0000d] in
10-27 12:36:23.830 I/MonoDroid(26172): at Syncfusion.SfDataGrid.XForms.SfDataGrid.OnItemsSourceChanged (Xamarin.Forms.BindableObject bindable, System.Object oldValue, System.Object newValue) [0x0026e] in
10-27 12:36:23.830 I/MonoDroid(26172): at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent) [0x00108] in C:\agent\_work\3\s\Xamarin.Forms.Core\BindableObject.cs:596
10-27 12:36:23.830 I/MonoDroid(26172): at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in C:\agent\_work\3\s\Xamarin.Forms.Core\BindableObject.cs:390
10-27 12:36:23.830 I/MonoDroid(26172): at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x001f9] in C:\agent\_work\3\s\Xamarin.Forms.Core\BindingExpression.cs:174
10-27 12:36:23.830 I/MonoDroid(26172): at Xamarin.Forms.BindingExpression.Apply (System.Boolean fromTarget) [0x0003e] in C:\agent\_work\3\s\Xamarin.Forms.Core\BindingExpression.cs:56
10-27 12:36:23.830 I/MonoDroid(26172): at Xamarin.Forms.BindingExpression+BindingExpressionPart.
10-27 12:36:23.830 I/MonoDroid(26172): at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in
10-27 12:36:23.830 I/MonoDroid(26172): at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in
10-27 12:36:23.830 I/MonoDroid(26172): at (wrapper dynamic-method) System.Object:f0ee84ee-977a-462d-913e-a7d7e4a8afd9 (intptr,intptr)
10-27 12:36:23.855 W/art (26172): JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable
10-27 12:36:23.862 D/Mono (26172): DllImport searching in: '__Internal' ('(null)').
10-27 12:36:23.862 D/Mono (26172): Searching for 'java_interop_jnienv_throw'.
10-27 12:36:23.862 D/Mono (26172): Probing 'java_interop_jnienv_throw'.
10-27 12:36:23.862 D/Mono (26172): Found as 'java_interop_jnienv_throw'.
An unhandled exception occured.
10-27 12:36:24.576 E/mono (26172):
10-27 12:36:24.576 E/mono (26172): Unhandled Exception:
10-27 12:36:24.576 E/mono (26172): System.InvalidOperationException: SortColumnDescription already exist in SfDataGrid.SortColumnDescriptions
10-27 12:36:24.576 E/mono-rt (26172): [ERROR] FATAL UNHANDLED EXCEPTION: System.InvalidOperationException: SortColumnDescription already exist in SfDataGrid.SortColumnDescriptions
- 28 Replies
- 6 Participants
-
LU Luca
- Aug 5, 2017 01:46 PM UTC
- Nov 23, 2017 06:50 PM UTC