Select to view content in your preferred language

FeatureDataGrid causes all graphics in a FeatureLayer to be updated

720
3
06-21-2011 04:19 AM
MarkusHjärne
Deactivated User
Hi,

we're developing an application with version 2.1 of the Silverlight API where we wanted to update an ModifiedBy attribute for each graphic that is changed by the user.

So we wired up the BeginSaveEdits event on the FeatureLayer that the user can edit to update the ModifiedBy attribute for each changed graphic before it gets saved.

But it turned out that as soon as the layer was loaded with data, the BeginSaveEdits event handler was called with all graphics loaded in the layer minus one in the Changed collection.

Further investigation turned out that this seemed to be caused by the FeatureDataGrid in the application in conjunction with having AutoSave set to true on the FeatureLayer.

I have replicated the behavior by changing your FeatureDataGrid sample (http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ToolkitFeatureDataGrid) by adding a handler to the BeginSaveEdits event of the IncidentsLayer and settings AutoSave to True for the same layer and then setting a break point in the event handler.

Is there a way to work around this?

Regards,

Markus H
0 Kudos
3 Replies
MarkusHjärne
Deactivated User
Hi again,

we've done some more testing with this. We've realized that we cannot use the BeginSaveEdits event to change updated and added graphics since that triggers another save resulting in recursion, so we have to set our ModefiedBy attribute explictly whenever a graphic attribute is changed.

But the problem with the FeatureDataGrid causing all graphics to be updated still remains. Just adding a BeginSaveEdits event handler to the IncidentsLayer in the sample (http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ToolkitFeatureDataGrid) and leaving AutoSave set to False reveals that the first time a graphic attribute is changed in the FeatureDataGrid and committed, all graphics get updated.

We're still in need of a workaround for this.
0 Kudos
MarkusHjärne
Deactivated User
For those who might run into the same problem, we still haven't found a workaround for this in version 2.1 of the Silverlight API, but we cannot replicate the problem above using version 2.2 of the API so it seems to be a bug that has been solved there.
0 Kudos
JenniferNery
Esri Regular Contributor
Thank you for your update. We're glad that this issue no longer persist in v2.2.
0 Kudos