In addition to Jennifer's comments you could alternatively do the following:Do not include your primary key field in your layer OutFields property if the value for your primary key field could be populated through your code. This way the primary key field won't show up in the edit attributes form of the editor widget control and there won't be any risk of overwriting that value by the end users.
You need to listen to the Graphics.CollectionChanged handler of your FeatureLayer and for each new item set your primary key attribute.
Listen to EditCompleted event handler of your EditorWidget. You should check for Editor.EditAction.Add for the Action peoperty of the EditEventArgs.
This is related thread: http://forums.arcgis.com/threads/9756-Undo-edits-of-the-EditorWidget (see post #9) to wire up to TemplatePicker's Editor.EditCompleted event.
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.