If i use classbreakstyle on InMemoryFeatureLayer and have a feature in there which have a null column value, it will throw exception when the refresh() is called. The same thing happen if a column exist in the InMemoryFeatureLayer but there's no ColumnValue at the feature.
Does it intentionally enforce column value to have value or column value exist within a layer to use a classbreak? Is there any workaround so that it works?
Can you arrange a sample application for us so that we can re-create your problems exactly? I checked the DrawCore method of ClassBreakStyle class and found out if the column value is null, it will not throw any exceptions. So I need your sample to re-create this problem and fix it.
Thanks for your code! I re-created your the NullReference exception exactly, I'm looking for a solution for you if there are any results I will let you know,
Thanks for your code! I re-created your the NullReference exception exactly, because the feature.ColumnValues["data"] value is null and the conversion is failed. There is a workaround for this issue, please refer the following code:
public class MyClassBreakStyle : ClassBreakStyle { public MyClassBreakStyle(string columnName) :base(columnName) {}
newFeatures.Add(feature); } base.DrawCore(newFeatures, canvas, labelsInThisLayer, labelsInAllLayers); } } Please add the custom class above to your sample and use the MyClassBreakStyle to instead of the ClassBreakStyle when calling the ClassBreakStyle object. Then it will bypass the NullReference exception.