Hi alberto,Thanks for your patience.We are checked your code snippet and try to reproduce the issue using your code snippet form our side. But the issue does not reproduce from side. We have attached the sample we checked for your reference and you can download the same from the below location.Can you please share more details about how you are using the DataGrid or if you could please replicate the issue in attached sample with clear replication procedure, it will be useful to provide the better solution.Regards,Sivaraman
Hi alberto,Thanks for your patience.We are checked your code snippet and try to reproduce the issue using your code snippet form our side. But the issue does not reproduce from side. We have attached the sample we checked for your reference and you can download the same from the below location.Can you please share more details about how you are using the DataGrid or if you could please replicate the issue in attached sample with clear replication procedure, it will be useful to provide the better solution.Regards,Sivaraman
@Sivaraman Sivagurunathan what do you think about my post?Edit: Error is something like:System.NullReferenceException: Object reference not set to an instance of an object.at Syncfusion.SfDataGrid.XForms.Droid.ExtendedScrollViewRenderer.OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs`1[TElement] e) [0x00061] in <7ff5c9cfa9474956970d35efb023ef5d>:0After updated Syncfusion to the v15.4.0.20, I have similar issue on Android, however iOS works well. (Also this issue occurs in v15.4.0.17.)In a page, I have a data grid and stacklayout. Data grid created first, then stacklayout created and after that data grid is added as children to the stacklayout. My program breaks at this step and NullReference error returns me.Is anybody has a solution except downgrading Syncfusion version?
i cleaned up nuget, restaill all but nothing changed.here the exception i getUnhandled Exception:System.NullReferenceException: Object reference not set to an instance of an objectat Syncfusion.SfDataGrid.XForms.RowGenerator.CreateDataRow (System.Int32 rowIndex, Syncfusion.GridCommon.ScrollAxis.VisibleLinesCollection visibleColumns, Syncfusion.SfDataGrid.XForms.RowRegion region) [0x001fd] in <07ed0835200b40a5911d90f6c5954de2>:0at Syncfusion.SfDataGrid.XForms.RowGenerator.EnsureRows (Syncfusion.GridCommon.ScrollAxis.VisibleLinesCollection visibleRows, Syncfusion.GridCommon.ScrollAxis.VisibleLinesCollection visibleColumns) [0x001e0] in <07ed0835200b40a5911d90f6c5954de2>:0at Syncfusion.SfDataGrid.XForms.VisualContainer.ensureItems (System.Boolean needToRefresh) [0x0002a] in <07ed0835200b40a5911d90f6c5954de2>:0at Syncfusion.SfDataGrid.XForms.VisualContainer.OnSizeAllocated (System.Double width, System.Double height) [0x00271] in <07ed0835200b40a5911d90f6c5954de2>:0at Xamarin.Forms.VisualElement.SizeAllocated (System.Double width, System.Double height) [0x00000] in D:\agent\_work\1\s\Xamarin.Forms.Core\VisualElement.cs:637at Xamarin.Forms.Layout.ForceLayout () [0x00000] in D:\agent\_work\1\s\Xamarin.Forms.Core\Layout.cs:115at Syncfusion.SfDataGrid.XForms.GridSelectionController.RefreshSelection () [0x0010e] in <07ed0835200b40a5911d90f6c5954de2>:0at Syncfusion.SfDataGrid.XForms.GridSelectionController.ProcessSourceCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e, Syncfusion.SfDataGrid.XForms.CollectionChangedReason reason) [0x001df] in <07ed0835200b40a5911d90f6c5954de2>:0at Syncfusion.SfDataGrid.XForms.GridSelectionController.HandleCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e, Syncfusion.SfDataGrid.XForms.CollectionChangedReason reason) [0x0000c] in <07ed0835200b40a5911d90f6c5954de2>:0at Syncfusion.SfDataGrid.XForms.GridModel.OnRecordCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00134] in <07ed0835200b40a5911d90f6c5954de2>:0at Syncfusion.Data.CollectionViewAdv.RaiseCollectionChangedEvent (System.Collections.Specialized.NotifyCollectionChangedEventArgs args) [0x00008] in <25b98b7b5c88470fbbbb56ddefa28cc1>:0at Syncfusion.Data.CollectionViewAdv.RefreshView (System.Collections.Specialized.NotifyCollectionChangedEventArgs args) [0x00000] in <25b98b7b5c88470fbbbb56ddefa28cc1>:0at Syncfusion.Data.CollectionViewAdv.Refresh () [0x00038] in <25b98b7b5c88470fbbbb56ddefa28cc1>:0at Syncfusion.Data.CollectionViewAdv.EndDeferInternal () [0x000eb] in <25b98b7b5c88470fbbbb56ddefa28cc1>:0at Syncfusion.Data.CollectionViewAdv.EndDefer () [0x00008] in <25b98b7b5c88470fbbbb56ddefa28cc1>:0at Syncfusion.Data.CollectionViewAdv+DeferHelper.Dispose (System.Boolean isDisposing) [0x00014] in <25b98b7b5c88470fbbbb56ddefa28cc1>:0at Syncfusion.Data.CollectionViewAdv+DeferHelper.Dispose () [0x00000] in <25b98b7b5c88470fbbbb56ddefa28cc1>:0at Syncfusion.SfDataGrid.XForms.SfDataGrid.DeferRefresh () [0x00064] in <07ed0835200b40a5911d90f6c5954de2>:0at Syncfusion.SfDataGrid.XForms.SfDataGrid.SetSourceList (System.Object source) [0x0000d] in <07ed0835200b40a5911d90f6c5954de2>:0at Syncfusion.SfDataGrid.XForms.SfDataGrid.OnItemsSourceChanged (Xamarin.Forms.BindableObject bindable, System.Object oldValue, System.Object newValue) [0x0026e] in <07ed0835200b40a5911d90f6c5954de2>:0at 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) [0x0011b] in D:\agent\_work\1\s\Xamarin.Forms.Core\BindableObject.cs:597at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes) [0x0015b] in D:\agent\_work\1\s\Xamarin.Forms.Core\BindableObject.cs:391at Xamarin.Forms.BindingExpression.ApplyCore (System.Object sourceObject, Xamarin.Forms.BindableObject target, Xamarin.Forms.BindableProperty property, System.Boolean fromTarget) [0x001f9] in D:\agent\_work\1\s\Xamarin.Forms.Core\BindingExpression.cs:174at Xamarin.Forms.BindingExpression.Apply (System.Boolean fromTarget) [0x0003e] in D:\agent\_work\1\s\Xamarin.Forms.Core\BindingExpression.cs:56at Xamarin.Forms.BindingExpression+BindingExpressionPart.<PropertyChanged>b__47_0 () [0x00000] in D:\agent\_work\1\s\Xamarin.Forms.Core\BindingExpression.cs:551at Foundation.NSAsyncActionDispatcher.Apply () [0x00000] in /Users/builder/data/lanes/5665/6857dfcc/source/xamarin-macios/src/Foundation/NSAction.cs:163at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Users/builder/data/lanes/5665/6857dfcc/source/xamarin-macios/src/UIKit/UIApplication.cs:79at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/5665/6857dfcc/source/xamarin-macios/src/UIKit/UIApplication.cs:63at IXApp.iOS.Application.Main (System.String[] args) [0x00001] in D:\Dev\Updater\IXApp\IXApp.iOS\Main.cs:17
Hi Chang Chiew Thou,Thanks for the updateWe are waiting for your valuable response.Regards,Suriya K
private void DataGridQueryRowStyleHandler(object sender, QueryRowStyleEventArgs e)
{
e.Style.ForegroundColor = Color.Red;
e.Handled = true;
}