Cannot input new data into FeatureDataForm

518
3
04-12-2013 07:45 AM
JessicaLott
New Contributor III
I am wanting to update the fields on my server using a FeatureDataForm. I have followed the documentation, but it still does not work. It also does not have the buttons in the form that say 'OK' and 'Delete' like the documentation does. Any help will be appreciated.

XAML (FeatureDataForm):

  
 <Border x:Name="FeatureDataFormBorder" 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="MyFeatureDataForm"  Foreground="Black" BorderBrush="{StaticResource PanelGradient}" BorderThickness="12"
                                             IsReadOnly="False" LabelPosition="Left" />
                </Border>



XAML(MyMap):

  
 <esri:Map x:Name="MyMap" Background="#FFE3E3E3" WrapAround="True"  MouseRightButtonDown="MyMap_MouseRightButtonDown" Extent="-9834972.92753924,4441899.425293319,-9833977.88119163, 4442762.485358352" Loaded="MyMap_Loaded">
                    <esri:Map.Layers>
                        <esri:ArcGISTiledMapServiceLayer ID="MyLayer" Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
                        <esri:FeatureLayer ID="WaterValves" Url="http://localhost:6080/arcgis/rest/services/CalvertCity_Test_2/MapServer/0" Renderer="{StaticResource MySimpleRenderer}"
                                                      OutFields="*" MouseLeftButtonUp="FeatureLayer_MouseLeftButtonUp" MouseLeftButtonDown="FeatureLayer_MouseLeftButtonDown_1" DisableClientCaching="True"  Mode="OnDemand"/>
                        <esri:GraphicsLayer ID="CandidateGraphicsLayer">
                            <esri:GraphicsLayer.MapTip>
                                <Grid>
                                    <Rectangle Stroke="Gray"  RadiusX="10" RadiusY="10" Fill="#77FF0000" Margin="0,0,0,5" >
                                        <Rectangle.Effect>
                                            <DropShadowEffect/>
                                        </Rectangle.Effect>
                                    </Rectangle>
                                    <Rectangle Fill="#DDFFFFFF" Stroke="DarkGray" RadiusX="5" RadiusY="5" Margin="10,10,10,15" />
                                    <StackPanel Orientation="Vertical" HorizontalAlignment="Center" Margin="30,20,30,30">
                                        <TextBlock Text="{Binding [Address]}" HorizontalAlignment="Left" Foreground="Black" />
                                    </StackPanel>
                                </Grid>
                            </esri:GraphicsLayer.MapTip>
                        </esri:GraphicsLayer>
                        <esri:ArcGISDynamicMapServiceLayer ID="CalvertCity" Url="http://localhost:6080/arcgis/rest/services/CalvertCity_Test_2/MapServer" />
                    </esri:Map.Layers>                
                </esri:Map>


C#:


   private void MyMap_Loaded(object sender, RoutedEventArgs e)
            {
                MyFeatureDataForm.FeatureLayer = MyMap.Layers[1] as ESRI.ArcGIS.Client.FeatureLayer;
            }
    
    
            private void FeatureLayer_MouseLeftButtonDown_1(object sender, GraphicMouseButtonEventArgs e)
            {
                e.Graphic.Selected = !e.Graphic.Selected;
                if (e.Graphic.Selected)
                    MyDataGrid.ScrollIntoView(e.Graphic, null);
            }
0 Kudos
3 Replies
vipulsoni
Occasional Contributor
Try the below code maybe the way you are doing the binding is wrong. Also try to set ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" UseLayoutRounding="False" , since due to layout issues you might not be able to see the buttons.

   private void MyMap_Loaded(object sender, RoutedEventArgs e)
            {
            
            Binding b = new Binding("Layers[WaterValves]");
            b.Source = _Map;// map control
            MyFeatureDataForm.SetBinding(ESRI.ArcGIS.Client.Toolkit.FeatureDataForm.FeatureLayerProperty, b);
            }
0 Kudos
DominiqueBroux
Esri Frequent Contributor
I am wanting to update the fields on my server using a FeatureDataForm. I have followed the documentation, but it still does not work. It also does not have the buttons in the form that say 'OK' and 'Delete' like the documentation does. Any help will be appreciated.

XAML (FeatureDataForm):

Check that your feature service supports these operations.
Send a request to the feature service end point and verify the list of supported operations (bottom of the page): sample.
0 Kudos
JessicaLott
New Contributor III
Thank you for your reply. My supported features and operations are different from yours. I do not have REST as a supported feature and the only supported operations are Query, Generate Rendered, and Return Updates. Could you explain how I would go about adding the rest of these features to my service?

Thank-You,

- Jessica
0 Kudos