Select to view content in your preferred language

Editing - Existin values got write-out

917
3
Jump to solution
05-24-2012 09:02 AM
ShaningYu
Honored Contributor
I create a tool to add new line features.  After enter the values for a new feature, the featuer is updated by
   pFC.UpdateFeature(pFeature);
When I open the table of the feature class, I observe that the new created feature does have the values as I entered.  However, the features created before loss their values (if it is int, its value  becomes 0).  How can I fix this bug?  Thanks if you can help.
0 Kudos
1 Solution

Accepted Solutions
ShaningYu
Honored Contributor
agray1:  Thanks for your hint.  I revised the code and used the Insert method.  Now it works well.

View solution in original post

0 Kudos
3 Replies
AlexanderGray
Honored Contributor
Based on what you said about the tool, I would recommend using store instead of updatefeature and I would also recommend creating the feature and setting the values within the same edit operation.  This will create and set the values all in one operation and will trigger the appropriate events that the different components of the editor extension and custom extension are expecting.  UpdateFeatures short-circuits the events, making faster for bulk updates but components relying on events won't work.

http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Creating_features/00010...
0 Kudos
ShaningYu
Honored Contributor
agray1:  Thanks for your hint.  I revised the code and used the Insert method.  Now it works well.
0 Kudos
AlexanderGray
Honored Contributor
Please mark the issue as answered if the problem is solved
0 Kudos