We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Data Grid Issue with grouped column

Thread ID:

Created:

Updated:

Platform:

Replies:

131966 Aug 5,2017 09:46 AM Nov 23,2017 01:50 PM Xamarin.Forms 28
loading
Tags: SfDataGrid
alberto
Asked On August 5, 2017 09:59 AM

Hi all,i have an issue when i use grouped column.first time everything work well, on the second update of my ObservableCollection i have this errorUNHANDLED EXCEPTION:08-05 15:57:51.325 I/MonoDroid(23427): UNHANDLED EXCEPTION:08-05 15:57:51.425 I/MonoDroid(23427): System.NullReferenceException: Object reference not set to an instance of an object.08-05 15:57:51.425 I/MonoDroid(23427):   at Syncfusion.SfDataGrid.XForms.SfDataGrid+<>c__DisplayClass327_0.b__0 (Syncfusion.SfDataGrid.XForms.GroupColumnDescription col) [0x00016] in <3ea70b4f0fbc450a8acf949b35d96088>:0 08-05 15:57:51.425 I/MonoDroid(23427):   at System.Linq.Enumerable+WhereEnumerableIterator`1[TSource].ToList () [0x0001b] in :0 08-05 15:57:51.425 I/MonoDroid(23427):   at System.Linq.Enumerable.ToList[TSource] (System.Collections.Generic.IEnumerable`1[T] source) [0x0001f] in :0 08-05 15:57:51.425 I/MonoDroid(23427):   at Syncfusion.SfDataGrid.XForms.SfDataGrid.OnItemsSourceChanged (Xamarin.Forms.BindableObject bindable, System.Object oldValue, System.Object newValue) [0x000a8] in <3ea70b4f0fbc450a8acf949b35d96088>:0 08-05 15:57:51.425 I/MonoDroid(23427):   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 15:57:51.425 I/MonoDroid(23427):   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 15:57:51.425 I/MonoDroid(23427):   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 15:57:51.425 I/MonoDroid(23427):   at Xamarin.Forms.BindingExpression.Apply (System.Boolean fromTarget) [0x0003e] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindingExpression.cs:55 08-05 15:57:51.426 I/MonoDroid(23427):   at Xamarin.Forms.BindingExpression+BindingExpressionPart.b__47_0 () [0x00000] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindingExpression.cs:539 08-05 15:57:51.426 I/MonoDroid(23427):   at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in :0 08-05 15:57:51.426 I/MonoDroid(23427):   at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in :0 08-05 15:57:51.426 I/MonoDroid(23427):   at (wrapper dynamic-method) System.Object:e7740405-0f1a-402e-9148-cab20ed07d58 (intptr,intptr)08-05 15:57:51.464 W/art     (23427): JNI RegisterNativeMethods: attempt to register 0 native methods for android.runtime.JavaProxyThrowable08-05 15:57:51.476 D/Mono    (23427): DllImport searching in: '__Internal' ('(null)').08-05 15:57:51.476 D/Mono    (23427): Searching for 'java_interop_jnienv_throw'.08-05 15:57:51.476 D/Mono    (23427): Probing 'java_interop_jnienv_throw'.08-05 15:57:51.476 D/Mono    (23427): Found as 'java_interop_jnienv_throw'.if i remove grouped column every work well.Can you help me please?thanks

alberto
Replied On August 5, 2017 10:10 AM

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'.


Vimal Prabhu Manohkaran [Syncfusion]
Replied On August 7, 2017 08:58 AM

Hi Alberto,

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
 


alberto
Replied On August 7, 2017 10:44 AM

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>


Vimal Prabhu Manohkaran [Syncfusion]
Replied On August 8, 2017 06:17 PM

Hi Alberto,

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.)
 
 2. Click on the button titled “Button1” in the top of the screen ( we are clearing the group column descriptions collection and adding a new GroupColumnDescription with a property from the CollectionTwo ) 
3. Click on the button titled “Button2” (we are changing the ItemSource of the grid to Collection_2 when the application crashes ) 
 
Sample Link :  http://www.syncfusion.com/downloads/support/forum/131966/ze/Formstest62914072

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
 


alberto
Replied On August 28, 2017 05:52 PM

hi,

yes i have the same error!

how can i fix it?

thanks


Ashok N [Syncfusion]
Replied On August 29, 2017 06:25 AM

Hi Alberto,  
  
Thanks for the confirmation.  
  
Already we had fixed this issue and this fix will be included in our 2017 Vol3 SP1 release, we will update you once release gets rolls out. We appreciate your patience until then.  
  
Regards,  
Ashok  


alberto
Replied On September 3, 2017 09:59 AM

hi,

after update now i have this error:

SortColumnDescription already exist in SfDataGrid.SortColumnDescriptions

thanks

alberto
Replied On September 3, 2017 10:24 AM

quick fix:

            this.dg.SortColumnDescriptions.Clear();


but it is only a workaround ;)



Ashok N [Syncfusion]
Replied On September 4, 2017 05:28 AM

Hi Alberto, 
 
Thanks for your update.  
 
We have checked the reported SortColumnDescription already exist issue with SfDataGrid v15.3.0.29 but we are not able to reproduce the reported issue with previously provided sample(August 8, 2017). Could you please check by clear your NuGet cache using below KB link, 
 
 
Still you are facing the issue, please do revert us by modifying our sample to replicate the issue or please share your sample along with replication procedure, that would be more helpful for us to proceed further.   
 
        
Regards, 
Ashok 


Emil
Replied On September 27, 2017 07:06 PM

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 :0 

09-28 02:03:32.017 I/MonoDroid(17490):   at Syncfusion.SfDataGrid.XForms.GridRowDragDropController.OnDragEnded () [0x00008] in :0 

09-28 02:03:32.017 I/MonoDroid(17490):   at Syncfusion.SfDataGrid.XForms.Droid.GridCellBaseRenderer.HandleTouchForRowDragAndDrop (Android.Views.MotionEvent e) [0x000d4] in :0 



Emil
Replied On September 27, 2017 07:53 PM

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" />

                   


                   


                       

                           

                               

                           

                       


                   

               

           


       


Divakar Subramaniam [Syncfusion]
Replied On September 28, 2017 11:25 AM

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. 


Emil
Replied On September 29, 2017 08:15 AM

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 :0 

09-29 15:09:06.804 I/MonoDroid(21886):   at Syncfusion.SfDataGrid.XForms.SfDataGrid.DeferRefresh () [0x0002c] in :0 

09-29 15:09:06.804 I/MonoDroid(21886):   at Syncfusion.SfDataGrid.XForms.SfDataGrid.SetSourceList (System.Object source) [0x0000d] in :0 

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 :0 

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.b__47_0 () [0x00000] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Core\BindingExpression.cs:539 

09-29 15:09:06.804 I/MonoDroid(21886):   at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in :0 

09-29 15:09:06.804 I/MonoDroid(21886):   at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in :0 

09-29 15:09:06.804 I/MonoDroid(21886):   at (wrapper dynamic-method) System.Object:5abf7f4c-5675-45b2-9b3a-29809e2d3f11 (intptr,intptr)

thanks,

Emil


alberto
Replied On September 29, 2017 08:47 AM

hi ,sorry for delay.

my 'stupid' fix is this

  private void PkCountry_SelectedIndexChanged(object sender, EventArgs e)

        {

            this.dgBrand.SortColumnDescriptions.Clear();

        }


Halil Dogan Bolak
Replied On September 30, 2017 10:24 AM

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.



Emil
Replied On September 30, 2017 04:33 PM

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.  


Emil
Replied On September 30, 2017 04:39 PM

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


Vimal Prabhu Manohkaran [Syncfusion]
Replied On October 2, 2017 05:49 AM

Dear Customers,

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.
 
 
  1. What is your requirement and what hurdle are you facing in achieving it?
  2. When does this error occur ? What operations are you performing in sequence?
  3. What are all the features enabled in SfDataGrid ?
  4. Sample code or the sample itself replicating the issue
  5. Or modify our sample attached below so that the issue can be replicated .
 
We will resolve the issue for you the earliest if we could have all these details , which will enable us to proceed further. 

Regards,
Vimal Prabhu
 


Emil
Replied On October 2, 2017 05:00 PM

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
 In the attached project, I extended ProductInfo model with DisplayOrder(int). I commented also 2 TODO lines. please enable each one by one and test them separately. 
1) Page1.xaml.cs ln:105 - this function updates model object with new order by updating displayorder after reordering. Then Raises Poperty changed on ObservableCollection of ProductInfo. I expect DisplayOrder should be updated in View
2) Page1.xaml.cs ln:146 This code is basically what you have on the link below. This is important if I am ordering within the same group (see point 3 above), but it throws another exception  https://help.syncfusion.com/xamarin/sfdatagrid/rowdraganddrop#reorder-the-underlying-data

Please let us know how can we continue from this?
thanks,
Emil

Attachment: Forms_e5abd2bd.7z

Ashok N [Syncfusion]
Replied On October 4, 2017 02:52 PM

Hi Emil, 
 
Thanks for your update. 
 
We have checked your query and In our UG document we have mentioned the reordering changes are made only in SfDataGrid.View and not in the underlying data. Thus the changes will be reverted when performing sorting, grouping or any other operation that refreshes the view. Reordering changes in the underlying data can be achieved by handling QueryRowDragging event in the sample side as explained below in Reordering underlying data. 
 
Regarding Issue 1: 
 
We have checked your sample and you are changing the collection in Drag ended. In DataGrid we do not change any view action while performing the UI action but you are trying to change the collection with Grouping so sorting also will applied to SfDataGrid so another UI action will get perform, this is not a DataGrid use case.  
 
Regarding Issue 2: 
 
You are reordering the records using getorder method, but need to set the delay for refresh the changes in view. We have modified the sample based on your requirement and attached in the below link, please refer it. 
 
 
Regards, 
Ashok 


alberto
Replied On October 24, 2017 04:52 PM

 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


Ashok N [Syncfusion]
Replied On October 25, 2017 01:04 PM

Hi Alberto, 
 
We have checked the reported issue and if we added the new SortColumnDescription with same name of already sorted column, the application was crash, we have throws this exception. So please confirm your side whether you are adding new SortColumnDescription column name was already not sorted? If you want to add the new SortColumnDescription to already added column, please clear that SortColumnDescription using SortColumnDescriptions.Clear method. Still you are facing the same issue please modified the below attached sample based on your requirement and revert to us, that would be more helpful for proceed further. 
In our sample we have added two different sort description and changed the collection in runtime , also added sort description based on the new collection. 
 
 
Regards, 
Ashok 


alberto
Replied On October 26, 2017 07:49 AM

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


Ashok N [Syncfusion]
Replied On October 27, 2017 05:44 AM

Hi Alberto, 

Thanks for your update. In our SfDataGrid if we change the collection, SfDataGrid will clear previously added Group column and sort column. We have tested this in SfdataGrid v15.3.0.33 release and all cleared while change the collection and newly added Group column has been added properly with sorting, could you please confirm whether you are able to reproduce the issue with this version? 

If you want to get the SfDataGrid in your ViewModel class , please pass our SfDataGrid is as a CommandParameter to a button, please refer the below KB link to get more detail about this command binding. 

If your requirement is differ from this and still you are facing the issue please modified the below attached sample based on your requirement and revert to us with detail replication procedure, that would be more helpful for proceed further.  


Regards, 
Ashok 


alberto
Replied On October 27, 2017 06:37 AM

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 :0 

10-27 12:36:23.830 I/MonoDroid(26172):   at Syncfusion.SfDataGrid.XForms.SfDataGrid.DeferRefresh () [0x0002c] in :0 

10-27 12:36:23.830 I/MonoDroid(26172):   at Syncfusion.SfDataGrid.XForms.SfDataGrid.SetSourceList (System.Object source) [0x0000d] in :0 

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 :0 

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.b__47_0 () [0x00000] in C:\agent\_work\3\s\Xamarin.Forms.Core\BindingExpression.cs:551 

10-27 12:36:23.830 I/MonoDroid(26172):   at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in :0 

10-27 12:36:23.830 I/MonoDroid(26172):   at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in :0 

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



Ashok N [Syncfusion]
Replied On October 30, 2017 07:43 AM

Hi Alberto,       
   
A support incident has been created under your account to track the status of this. Please log on to our support website to check for further updates       
       
Regards,       
Ashok      


alberto
Replied On November 21, 2017 04:35 PM

hi,
so is this close?
thanks

Ashok N [Syncfusion]
Replied On November 23, 2017 01:50 PM

Hi Alberto, 
 
Since, this is a public forum, so all users able to view about this forum. We request you to follow about your query from that created incident. 
 
Regards, 
Ashok 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;