Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In the OnChangeFeature event is there a way to determine which field was just edited causing the event to fire? I'm doing several tasks in OnChangeFeature that only need to happen when certain fields are edited, so being able to determine which field just changed would be helpful. Any suggestions?

share|improve this question
Did you try IRowChanges and loop through each field to see if ValueChanged is true? – Kirk Kuykendall Jul 8 '11 at 17:39
That is the way to go. I was going to answer but Kirk is like Skeet from SO. :P. – George Jul 8 '11 at 18:13
up vote 5 down vote accepted

Not sure why everyone is commenting instead of answering but here's an example with both an IRowChanges and an IFeatureChanges (in case you are interested in the geometry). I did have to strip out some lines of code, but this should be close:


        IRowChanges rowChanges = obj as IRowChanges;

        for (int i = 0; i < obj.Fields.FieldCount; i++)
                if (rowChanges.ValueChanged[i])
                    object oldValue = rowChanges.get_OriginalValue(i);
                    object newValue = obj.get_Value(i);     



        IFeatureChanges featureChanges = obj as IFeatureChanges;

        if (featureChanges != null && featureChanges.ShapeChanged)
            // Do something
            // featureChanges.OriginalShape
share|improve this answer
You can use IRow for the geometry field as well. All you have to do is to pass up the index of the geometry field. – George Jul 8 '11 at 19:01
+1 this looks good. – Kirk Kuykendall Jul 8 '11 at 19:32
IRowChanges is exactly what I was looking for. I'd give Kirk answer points as well if I could. Thanks to all. – Jeff Berry Jul 8 '11 at 20:23

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.