Select to view content in your preferred language

Spatial Query inside TemplatePicker_EditCompleted

616
1
11-03-2011 01:28 AM
NoureddineEl-zaatari
Emerging Contributor
im using template picker for creating a feature, im doing in the TemplatePicker_EditCompleted  a sptial query and based on the result of the spatial query, i want to clear all edits made and dispose the attributes form that popups when drawing is completed,

how can i ask the template picker to cancel edits done and dispose the FeatureDataForm,

thanks for any help
0 Kudos
1 Reply
JenniferNery
Esri Regular Contributor
Have you seen this SDK sample? http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#SpatialQuery. This seems more appropriate for what you are trying to achieve.

TemplatePicker will add graphics to your FeatureLayer. You might want to use a GraphicsLayer to hold this temporary graphic instead (as shown in the sample).

TemplatePicker has a ShowAttributesOnAdd property that you can set to False, this will disable the FeatureDataForm popup after completion of add. If you want to cancel the add, FeatureLayer must be AutoSave=False (it is true by default). You can then call UndoEdits() on TemplatePicker.EditCompleted.

I would still suggest you look at the SDK sample and use GraphicsLayer instead of FeatureLayer.
0 Kudos