In a few of my grids I receive a null pointer exception when I query the row height with SfDataGridHelpers.GetRowHeight. I put that one in a try/catch to get more info and to let the code continue on. After that passes however, I also an error:
2017-05-30 08:05:16.580 IosGold[98726:3181915] Unhandled managed exception:
Exception has been thrown by the target of an invocation. (System.Reflection.TargetInvocationException)
at Syncfusion.Data.Extensions.PropertyDescriptorExtensions.GetComplexPropertyValue (System.String[] propertyNameList, System.ComponentModel.PropertyDescriptorCollection tempitempproperties, System.Object record) [0x000c4] in <9753741c30de45aaad3bdc3a67541094>:0
at Syncfusion.Data.ItemPropertiesProvider.GetValue (System.Object record, System.String property) [0x0005d] in <9753741c30de45aaad3bdc3a67541094>:0
at Syncfusion.SfDataGrid.SfDataGridHelpers.GetCellValue (Syncfusion.SfDataGrid.SfDataGrid datagrid, System.Object recorddata, System.String columnname) [0x0001b] in <3680b4a196e04dda8d88dda86ec712c6>:0
.....
The given key was not present in the dictionary. (System.Collections.Generic.KeyNotFoundException)
at System.ThrowHelper.ThrowKeyNotFoundException () [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.8.0.175/src/mono/mcs/class/referencesource/mscorlib/system/throwhelper.cs:68
at System.Collections.Generic.Dictionary`2[TKey,TValue].get_Item (TKey key) [0x00021] in /Library/Frameworks/Xamarin.iOS.framework/Versions/10.8.0.175/src/mono/mcs/class/referencesource/mscorlib/system/collections/generic/dictionary.cs:183
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&)
I believe the issue here is that I am using a Dictionary<string,object> as my datasource, and some rows may not contain all of the fields for some of the columns. So if a column is mapped to something like Values[optionalValue], and optionalValue does not exist for a row, the whole table crashes. Is there a way to tell the grid to handle missing values with either a null value , empty string or some other non-exception scenerio?