I've got a featurelayer with a definition query set up where Expiration_date is null.When someone saves a feature with a non-null expiration date, I'd like for the graphic to disappear.In the EditCompleted eventhandler however, the graphic is null. Is this a bug?private void OnSaveFeatures(Editor.EditEventArgs e)
{
FeatureLayer fLayer = null;
foreach (Editor.Change c in e.Edits)
{
if (c.Layer.ID.ToUpper() == "ProjectPolys".ToUpper())
{
fLayer = c.Layer as FeatureLayer;
if (c.Graphic != null)
{
if (c.Graphic.Attributes.ContainsKey("Expiration_Date"))
{
if (c.Graphic.Attributes["Expiration_Date"] != null)
((FeatureLayer)c.Layer).Graphics.Remove(c.Graphic);
}
}
else
Debug.WriteLine("null graphic!");
}
}
if (fLayer != null)
fLayer.Update(); // this is a workaround
}