Select to view content in your preferred language

EditorWidget Attribute table events

517
2
12-13-2011 11:20 PM
JudyTroutwine
Regular Contributor
The attribute table (seems identical to a FeatureDataForm that can be customized when adding features) used to view and edit attribute values in the EditorWidget does not seem to be customizable or accessible by code in general.  Can one set up event procedures?
0 Kudos
2 Replies
JenniferNery
Esri Regular Contributor
That is correct, EditorWidget's display attribute show an instance of FeatureDataForm, events like EditEnded are not accessible from here. You can download source code to the toolkit from here: http://esrisilverlight.codeplex.com/.

If you want to change this behavior, you can add update the EditorWidget style by following these steps: http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2010/05/28/Localizing-ArcGIS-Controls.aspx. You can then implement a different button click event for displaying attributes by creating an instance of FeatureDataForm, this will give you access to its events.
0 Kudos
JudyTroutwine
Regular Contributor
In studying the toolkit code for the EditorWidget, I see that the ShowAttributesForm method is actually called by the Layer_MouseLeftButtonDown method (after the displayAttribute value has been set to true in DisplayAttribute_Click().  The ShowAttributesForm is in TemplatePicker.cs; thus the form shown by the EditorWidget and the TemplatePicker are identical and launched in the same method.  The difference in accessing events seems to be that TemplatePicker includes this command:  "public event EventHandler<ESRI.ArcGIS.Client.Editor.EditEventArgs> EditCompleted".
I attempted to add the same command to EditorWidget.cs.  The Editor_EditCompleted method immediately showed an error on this line:
"EventHandler<ESRI.ArcGIS.Client.Editor.EditEventArgs> handler = EditCompleted";

to the effect that the member is defined more than once.   I modified the code slightly to use the same Editor_EditCompleted method, OnEditCompleted method, and public event command sequence as in TemplatePicker.cs.  The same error message appeared.  Please advise.
0 Kudos