Yes, My Table is similar except that there's no relation.I've initialized my feature layer in XAML:<esri:FeatureLayer ID="TreeEdit_FeatureLayer"
Url="http://chgisservice/ArcGIS/rest/services/test/tree_inv_test2_FeatureAccess/FeatureServer/1"
DisableClientCaching="True"
Mode="OnDemand"
SelectionColor="Red"
FeatureSymbol="{StaticResource MyMarkerSymbol}"
OutFields="*"/>
Then I call update once a button is clicked (Functions similar to this post😞 private void editbutton_Click(object sender, RoutedEventArgs e)
{
try
{
FeatureLayer f = Map.Layers["TreeEdit_FeatureLayer"] as FeatureLayer;
MessageBox.Show("initialized: " + f.IsInitialized.ToString()); //will display True
f.UpdateCompleted += new EventHandler(featurelayer_updatecompleted);
f.UpdateFailed +=new EventHandler<TaskFailedEventArgs>(f_UpdateFailed);
f.Update();
}
catch (Exception exc)
{
MessageBox.Show(exc.Message);
}
}
My Update Completed Function to test the number of graphics: private void featurelayer_updatecompleted(object sender, System.EventArgs e)
{
FeatureLayer ff = Map.Layers["TreeEdit_FeatureLayer"] as FeatureLayer;
MessageBox.Show("update completed.");
MessageBox.Show("featurelayer graphics count: " + ff.Graphics.Count.ToString());
}
void f_UpdateFailed(object sender, TaskFailedEventArgs e)
{
MessageBox.Show(e.Error.Message);
}
It seems that the update will always go to UpdateFailed event. The MessageBox shows "Unable to Complete Operation".I checked my table using regular querytask. It returns correct records as usual. I still couldn't figure out where the problem is. Thanks!!