<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Editing Line Feature Layer in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/editing-line-feature-layer/m-p/376381#M9713</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a problem about editing my line features in feature layer. I can add line features to featurelayer, but cannot edit its properties.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
public void AddFeature()
{
 FeatureLayer f_layer = (FeatureLayer)Map.Layers["Links"];
 f_layer.DisableClientCaching = true;
 f_layer.UpdateCompleted += new EventHandler(f_layer_UpdateCompleted);
 f_layer.Update();
}
private void f_layer_UpdateCompleted(object sender, EventArgs e)
{
 FeatureLayer feature_layer = (FeatureLayer)Map.Layers["Links"];

 ESRI.ArcGIS.Client.Geometry.Polyline line = new ESRI.ArcGIS.Client.Geometry.Polyline();

 MapPoint point1 = new MapPoint(35,40,feature_layer.SpatialReference);
 MapPoint point2 = new MapPoint(36,41,feature_layer.SpatialReference);

 ESRI.ArcGIS.Client.Geometry.PointCollection point_collection = new ESRI.ArcGIS.Client.Geometry.PointCollection();

 point_collection.Add(point1);
 point_collection.Add(point2);

 line.Paths.Add(point_collection);
 line.SpatialReference = feature_layer.SpatialReference;

 Graphic graph = new Graphic();

 graph.Geometry = line;
 graph.Attributes["TypeID"] = 2;
 graph.Attributes["Custom1"] = "Value";

 feature_layer.Graphics.Add(graph);
}

public void EditFeature()
{
 FeatureLayer f_layer = (FeatureLayer)Map.Layers["Links"];
 f_layer.DisableClientCaching = true;
 f_layer.UpdateCompleted += new EventHandler(f_layer_UpdateCompleted);
 f_layer.EndSaveEdits += new EventHandler&amp;lt;EndEditEventArgs&amp;gt;(f_layer_EndSaveEdits);
 f_layer.SaveEditsFailed += new EventHandler&amp;lt;TaskFailedEventArgs&amp;gt;(f_layer_SaveEditsFailed);
 f_layer.Update(); 
}
private void f_layer_UpdateCompleted(object sender, EventArgs e)
{
 FeatureLayer feature_layer = (FeatureLayer)Map.Layers["Links"];
 
 feature_layer.Graphics[0].Attributes["TypeID"] = 3;
 feature_layer.Graphics[0].Attributes["Custom1"] = "New Value"; 
}
private void f_layer_EndSaveEdits(object sender, EndEditEventArgs e)
{
 MessageBox.Show("Feature Editted");
}
private void f_layer_SaveEditsFailed(object sender, TaskFailedEventArgs e)
{
 MessageBox.Show(e.Error.Message);
}
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the code above I can add feature by &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;AddFeature&lt;/SPAN&gt;&lt;SPAN&gt; function without any problem. But when I want to edit the feature I added in &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;EditFeature&lt;/SPAN&gt;&lt;SPAN&gt; funtion. After &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;f_layer_UpdateCompleted&lt;/SPAN&gt;&lt;SPAN&gt; event handler, I receive &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Unable to complete operation&lt;/SPAN&gt;&lt;SPAN&gt; error message in &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;f_layer_SaveEditsFailed&lt;/SPAN&gt;&lt;SPAN&gt; event handler.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you have any idea about the problem, please help me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Kerem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 28 Feb 2011 09:55:21 GMT</pubDate>
    <dc:creator>KeremCelik</dc:creator>
    <dc:date>2011-02-28T09:55:21Z</dc:date>
    <item>
      <title>Editing Line Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/editing-line-feature-layer/m-p/376381#M9713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a problem about editing my line features in feature layer. I can add line features to featurelayer, but cannot edit its properties.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
public void AddFeature()
{
 FeatureLayer f_layer = (FeatureLayer)Map.Layers["Links"];
 f_layer.DisableClientCaching = true;
 f_layer.UpdateCompleted += new EventHandler(f_layer_UpdateCompleted);
 f_layer.Update();
}
private void f_layer_UpdateCompleted(object sender, EventArgs e)
{
 FeatureLayer feature_layer = (FeatureLayer)Map.Layers["Links"];

 ESRI.ArcGIS.Client.Geometry.Polyline line = new ESRI.ArcGIS.Client.Geometry.Polyline();

 MapPoint point1 = new MapPoint(35,40,feature_layer.SpatialReference);
 MapPoint point2 = new MapPoint(36,41,feature_layer.SpatialReference);

 ESRI.ArcGIS.Client.Geometry.PointCollection point_collection = new ESRI.ArcGIS.Client.Geometry.PointCollection();

 point_collection.Add(point1);
 point_collection.Add(point2);

 line.Paths.Add(point_collection);
 line.SpatialReference = feature_layer.SpatialReference;

 Graphic graph = new Graphic();

 graph.Geometry = line;
 graph.Attributes["TypeID"] = 2;
 graph.Attributes["Custom1"] = "Value";

 feature_layer.Graphics.Add(graph);
}

public void EditFeature()
{
 FeatureLayer f_layer = (FeatureLayer)Map.Layers["Links"];
 f_layer.DisableClientCaching = true;
 f_layer.UpdateCompleted += new EventHandler(f_layer_UpdateCompleted);
 f_layer.EndSaveEdits += new EventHandler&amp;lt;EndEditEventArgs&amp;gt;(f_layer_EndSaveEdits);
 f_layer.SaveEditsFailed += new EventHandler&amp;lt;TaskFailedEventArgs&amp;gt;(f_layer_SaveEditsFailed);
 f_layer.Update(); 
}
private void f_layer_UpdateCompleted(object sender, EventArgs e)
{
 FeatureLayer feature_layer = (FeatureLayer)Map.Layers["Links"];
 
 feature_layer.Graphics[0].Attributes["TypeID"] = 3;
 feature_layer.Graphics[0].Attributes["Custom1"] = "New Value"; 
}
private void f_layer_EndSaveEdits(object sender, EndEditEventArgs e)
{
 MessageBox.Show("Feature Editted");
}
private void f_layer_SaveEditsFailed(object sender, TaskFailedEventArgs e)
{
 MessageBox.Show(e.Error.Message);
}
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the code above I can add feature by &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;AddFeature&lt;/SPAN&gt;&lt;SPAN&gt; function without any problem. But when I want to edit the feature I added in &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;EditFeature&lt;/SPAN&gt;&lt;SPAN&gt; funtion. After &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;f_layer_UpdateCompleted&lt;/SPAN&gt;&lt;SPAN&gt; event handler, I receive &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Unable to complete operation&lt;/SPAN&gt;&lt;SPAN&gt; error message in &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;f_layer_SaveEditsFailed&lt;/SPAN&gt;&lt;SPAN&gt; event handler.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you have any idea about the problem, please help me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Kerem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Feb 2011 09:55:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/editing-line-feature-layer/m-p/376381#M9713</guid>
      <dc:creator>KeremCelik</dc:creator>
      <dc:date>2011-02-28T09:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: Editing Line Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/editing-line-feature-layer/m-p/376382#M9714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Does your service contain these editable fields (TypeID, Custom1)? If yes, do they match the data type value (TypeID a number, Custom1 a string)? Kindly inspect the Error in the SaveEditsFailed. Also, you might want to run Fiddler with your app to see how the web request is formed when applying these edits. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Looking at your code, I would not advice adding the graphics in the UpdateCompleted event. This event is also raised the first time feature service is querried for existing features and every time you call Update() on the layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just to clarify, without the attribute change, you are able to see the newly added features in your service? What version of the API are you using? Can you also share code on how FeatureLayer is created? Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Feb 2011 18:34:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/editing-line-feature-layer/m-p/376382#M9714</guid>
      <dc:creator>JenniferNery</dc:creator>
      <dc:date>2011-02-28T18:34:29Z</dc:date>
    </item>
    <item>
      <title>Re: Editing Line Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/editing-line-feature-layer/m-p/376383#M9715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Does your service contain these editable fields (TypeID, Custom1)? If yes, do they match the data type value (TypeID a number, Custom1 a string)? Kindly inspect the Error in the SaveEditsFailed. Also, you might want to run Fiddler with your app to see how the web request is formed when applying these edits. &lt;BR /&gt;&lt;BR /&gt;Looking at your code, I would not advice adding the graphics in the UpdateCompleted event. This event is also raised the first time feature service is querried for existing features and every time you call Update() on the layer.&lt;BR /&gt;&lt;BR /&gt;Just to clarify, without the attribute change, you are able to see the newly added features in your service? What version of the API are you using? Can you also share code on how FeatureLayer is created? Thanks.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks a lot for your quick response.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For fields, they are editable, I re-checked and the data type matched with the feature layer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For UpdateCompleted event, I forgot to add the following line to the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;f_layer_UpdateCompleted&lt;/SPAN&gt;&lt;SPAN&gt; event handler, I usually put (sender as FeatureLayer).UpdateCompleted -= f_layer_UpdateCompleted; in the first line. To prevent feature layer to re-call this event when update function called.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I can see the feature I added right after I add them,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The API version is 2.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Creation of feature layer is in the server. I have a SDE database and a Line FeatureClass in it. (The table is registered as versioned) I put the featureclass into an mxd file and published in ArcGIS Server Manager. (I have other layers, I can add new features to them, edit existing features, and delete them without any problem)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I add feature layer into my Map with the following xaml code (I set the Url in code behind):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;esri:FeatureLayer ID="Links" Opacity="1" DisableClientCaching="True" Where="TypeID = 3"&amp;nbsp; Renderer="{StaticResource BlackRenderer}" /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have another consideration :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I add feature without Geometry and Symbol attribute set, I can edit the existing feature with the code I posted. I think the problem is in the Geometry setting part. But I could not identified.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Kerem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2011 07:23:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/editing-line-feature-layer/m-p/376383#M9715</guid>
      <dc:creator>KeremCelik</dc:creator>
      <dc:date>2011-03-01T07:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: Editing Line Feature Layer</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/editing-line-feature-layer/m-p/376384#M9716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Finally I solved my problem, I am not sure what the problem is but what I did is just create the line feature class again with fields and the problem is solved.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks again for your help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Kerem.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Mar 2011 12:53:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/editing-line-feature-layer/m-p/376384#M9716</guid>
      <dc:creator>KeremCelik</dc:creator>
      <dc:date>2011-03-01T12:53:42Z</dc:date>
    </item>
  </channel>
</rss>

