Select to view content in your preferred language

Editing Guid fields

2274
4
09-21-2010 09:56 AM
WilliamKimrey
Emerging Contributor
Hello all,

I'm hoping that I'm just doing this wrong, but I can't seem to change a GUID field's value with a FeatureDataGrid.  I think this is the way to do it:

FeatureDataGrid.BeginEdit();
FeatureDataGrid.SelectedGraphics[0].Attributes["NAME_GUID"] = newGUID;
FeatureDataGrid.CommitEdit();

If I check the attribute before and after this code is executed the GUIDs are different.  However, this change does not persist.

So, am I just doing this wrong, or is there a problem with editing GUIDs?

Thanks,
Will
0 Kudos
4 Replies
AliMirzabeigi
Emerging Contributor
Like the ObjectID fields GUID (GlobalID) fields are automatically assigned by the server and cannot be modified by users.
0 Kudos
WilliamKimrey
Emerging Contributor
Thanks for the heads up.  Just to clarify, I can't edit ANY Guid field?  Or can i just not edit GlobalID fields.  I don't have GlobalIDs for this featureclass so I just want to make sure that it's a limitation on the GUID type rather than specific field names.
0 Kudos
AliMirzabeigi
Emerging Contributor
GUID fields are identified as type of esriFieldTypeGlobalID (this is what I meant by GlobalID fields in my previous post) and they cannot be edited (assigned by the server) regardless of their field names.
0 Kudos
WilliamKimrey
Emerging Contributor
Ok, thanks for the clarification.  Guess I'll have to figure out something else.
0 Kudos