Select to view content in your preferred language

Edit Featuer Class

715
4
01-03-2012 06:44 AM
JayKappy
Frequent Contributor
I am trying to edit a feature in Silverlight VB..I am usign teh ESRI examples from:
http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ToolkitFeatureDataForm

I can get the Dataform to popup and display data when selected in the map but the textboxes are grayed out and non editable....any thoughts?  Permissions back to Map Service? missing code to define teh editable feature?

I can edit the same points with the out of box aspx examples...but not from the example above

Thoughts?

This is what I got taking from the example:
XAML:
<!-- Point example for editing -->
    <esri:FeatureLayer ID="MG_Point" Visible="True" 
         Url="http://gis.org/arcgis/rest/services/MG_Test/MapServer/22" 
         MouseLeftButtonUp="Points_MouseLeftButtonUp" DisableClientCaching="True" Mode="OnDemand"
         SelectionColor="#FFFFFF00" OutFields="*" />


<!-- Points DataFrom Border Editor-->
<Border x:Name="PointDataFormBorder" Visibility="Collapsed" 
        HorizontalAlignment="Right" VerticalAlignment="Top" Margin="10,10,10,0" Width="300" Height="300" >
   <Border.Effect>
   <DropShadowEffect Color="Black" Direction="-45" BlurRadius="20" Opacity=".75" />
      </Border.Effect>
         <esri:FeatureDataForm x:Name="MyPointFeatureDataForm"
               FeatureLayer="{Binding Path=Layers[MG_Point], ElementName=MyMap}" 
               IsReadOnly="False" LabelPosition="Left" />
</Border>

VB:
    Private Sub Points_MouseLeftButtonUp(ByVal sender As Object, ByVal args As GraphicMouseButtonEventArgs)
        Dim featureLayer As FeatureLayer = TryCast(sender, FeatureLayer)

        For Each g As Graphic In featureLayer.Graphics
            If (g.Selected) Then
                g.UnSelect()
            End If
        Next

        args.Graphic.Select()
        MyPointFeatureDataForm.GraphicSource = args.Graphic

        PointDataFormBorder.Visibility = Visibility.Visible
    End Sub
0 Kudos
4 Replies
JayKappy
Frequent Contributor
There is an editor out of box example in aspx I think when you get ArcServer...I was wondering if that example exists in VB or CS solution that I can view in Visual Studio?

I am trying to edit against a Feature Service on another server....I can edit through the out of box example from ESRI as mentioned above (located on their server), with the app on the 3rd party server....but I cannot edit using the example from my first post with the app on my local computer and the data residing on their server....The only thing I can see here is potential rights? Permissions? the app location, or maybe all combined...

Thougths?
0 Kudos
JenniferNery
Esri Regular Contributor
FeatureDataForm is in read-only mode because the FeatureLayer is also read-only (Url points to MapServer).
0 Kudos
JayKappy
Frequent Contributor
What do I need to set it as to be editable?

The ESRI example (Link in first post) has it set up as a FeatureLayer????  I am following the example verbatum

http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ToolkitFeatureDataForm

THanks

EDIT: Wait think I see what you are talking about.....

I tried this and got an error:  screen just goes blank

Url="http://gis.org/arcgis/rest/services/MG_Test/FeatureServer/22"
0 Kudos
JayKappy
Frequent Contributor
THank you Jennifer...that was the problem....data is in the Feature Server and all good to go...
0 Kudos