Hi All,
I am trying to edit a standalone table data from a file GDB. I did following steps without success.
1 Created an ArcMap document with som Feature classes and added some standalone tables to document. Some of the tables are related to Feature classes in .mxd.
Then I Created MPK for ArcMap doc.
2 Then I tried to add feature class and a table to map in xaml
<esri:Map x:Name="MyMap" Background="White" Extent="693502,7082101,709164,7092494" >
<esri:ArcGISLocalFeatureLayer ID="Avdelning" Path="C:\\..\test.mpk"
LayerName="Avdelning"
AutoSave="False"
Editable="True"
OutFields="*"
Mode="OnDemand" Initialized="ArcGISLocalFeatureMapServiceLayer_Initialized" />
<esri:ArcGISLocalFeatureLayer ID="TAVBESTAND" Path=" C:\\..\test.mpk"
LayerName="TAVBESTAND"
AutoSave="False"
Editable="True"
OutFields="*"
Mode="Snapshot" />
</esri:Map>
Got error message:
�??A layer with name TAVBESTAND is a table and cannot be used for a FeatureLayer�?�
3 I tried to add table as LocalFeatureLayer from code behind and got the same message.
LocalFeatureService.GetServiceAsync(@"C:\..\test.mpk.mpk", (localFeatureService) =>
{
arcGISLocalFeatureLayer1 = new ArcGISLocalFeatureLayer()
{
Service = localFeatureService, //Feature Class
LayerName = "Avdelning",
ID = "Avdelning",
Editable = true,
DisableClientCaching = true,
AutoSave = false,
Mode = ESRI.ArcGIS.Client.FeatureLayer.QueryMode.Snapshot,
OutFields = new OutFields() { "*" },
};
arcGISLocalFeatureLayer1.Initialized += (s, e) =>
{};
arcGISLocalFeatureLayer1.InitializationFailed += (s, e) =>
{};
arcGISLocalFeatureLayer1.UpdateCompleted += (s, e) =>
{
MyMap.IsEnabled = true;
};
arcGISLocalFeatureLayer2 = new ArcGISLocalFeatureLayer()
{
Service = localFeatureService, //This is a table
LayerName = "TAVBESTAND",
ID = "TAVBESTAND",
Editable = true,
Mode = ESRI.ArcGIS.Client.FeatureLayer.QueryMode.Snapshot,
OutFields = new OutFields() { "*" },
};
arcGISLocalFeatureLayer2.Initialized += (s, e) =>
{};
arcGISLocalFeatureLayer2.InitializationFailed += (s, e) =>
{};
arcGISLocalFeatureLayer2.UpdateCompleted += (s, e) =>
{
MyMap.IsEnabled = true;
};
MyMap.Layers.Add(arcGISLocalFeatureLayer1);
MyMap.Layers.Add(arcGISLocalFeatureLayer2);
});
I could see that the table was published in json with URL/layernumber.
Am I doing something wrong?
Thanks!