|
POST
|
Kindly check that your project references ESRI.ArcGIS.Client. I assume you were able to get rid of System.Runtime.Serialization error, by adding this reference. Also when copying code-behind, you need not replace your namespace, class name and constructor. You just copy the using or imports statements and code after InitializeComponent.
... View more
12-16-2011
11:57 AM
|
0
|
0
|
1715
|
|
POST
|
You can set FeatureLayer.ValidateEdits=False or fix your service. Your service defines the field as such: { "name" : "IrrigationType", "type" : "esriFieldTypeString", "alias" : "IrrigationType", "editable" : true, "length" : 2, "domain" : { "type" : "codedValue", "name" : "TreeIrrigationType", "codedValues" : [ { "name" : "Drip Irrigation", "code" : "DI" }, { "name" : "Gator Bags", "code" : "GB" }, { "name" : "Irrigation System", "code" : "IS" }, { "name" : "Non-Irrigated", "code" : "NI" } ] } }, with the following Prototype attribute: "prototype" : { "attributes" : { "IrrigationType" : " ", "TreeType" : "GRA", "TreeCondition" : null, "TreeValue" : 0, "TreeSize" : null, "DatePlanted" : null } Validation check in the client fails because space is not one of the expected coded-value domain, so you might want to change the default value in your prototype attribute.
... View more
12-16-2011
11:09 AM
|
0
|
0
|
792
|
|
POST
|
If you want to customize just the look and feel of the FeatureDataForm: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ToolkitFeatureDataForm, you can follow this blog post: http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2010/05/28/Localizing-ArcGIS-Controls.aspx. If you want to change the behavior of FeatureDataForm, you can download source from CodePlex: http://esrisilverlight.codeplex.com/ If you are using ChildWindow to display FeatureDataForm, you can use FeatureDataForm instance to get to the GraphicSource.
ChildWindow window = new ChildWindow();
FeatureDataForm form = new FeatureDataForm()
{
GraphicSource = graphic,
FeatureLayer = featureLayer,
IsReadOnly = !featureLayer.IsUpdateAllowed(graphic),
MaxWidth = 500,
MaxHeight = 500
};
window.Content = form;
form.EditEnded += (s, e) =>
{
var graphic = form.GraphicSource;
window.Close();
};
window.ShowDialog();
... View more
12-16-2011
10:51 AM
|
0
|
0
|
495
|
|
POST
|
Have you looked at this SDK sample? http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#EditToolsAutoSave. If you check Continous Action, this sets Editor.ContinuousMode=True. If you click on Select, the Select command remains active until another command is activated. I assume you have created Editor as resource and made your button DataContext point to this resource. You can set ContinuousMode="True" where you defined Editor in the resource.
... View more
12-16-2011
10:41 AM
|
0
|
0
|
766
|
|
POST
|
I'm not sure I understand the question. The following service has multiple coded-value domain as well and is supported in TemplatePicker: http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/operations/FeatureServer/0. TemplatePicker use Prototype Attributes in determining default values for fields based on feature type. If you try this feature service and set TemplatePicker.ShowAttributesOnAdd=True, you will see these attributes applied. Are you finding issues with your data?
... View more
12-16-2011
10:38 AM
|
0
|
0
|
792
|
|
POST
|
When you create a new Silverlight Application, you will get something like this. Only overwrite the highlighted text in red. You don't want to replace x:Class, xmlns, xmlns:x. Copy from xmlns:esri instead.
<UserControl x:Class="SilverlightApplication1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="White">
</Grid>
</UserControl>
... View more
12-15-2011
09:32 AM
|
0
|
0
|
1715
|
|
POST
|
You can use FeatureDataGrid.SelectionChanged event and iterate through e.AddedItems. To convert row to graphic, you can use the following method (add using System.Reflection).
private void MyDataGrid_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
foreach (var item in e.AddedItems)
{
var g = GetGraphicSibling(item);
}
}
private static Graphic GetGraphicSibling(object item)
{
if (item != null)
{
MethodInfo mi = item.GetType().GetMethod("GetGraphicSibling");
if (mi != null)
return mi.Invoke(item, null) as Graphic;
}
return null;
}
... View more
12-15-2011
09:28 AM
|
0
|
0
|
710
|
|
POST
|
According to Mark who posted the same stack trace, the issue seemed to have been resolved without code change so it might have been the service you are hitting.
... View more
12-14-2011
04:02 PM
|
0
|
0
|
3880
|
|
POST
|
Here's an example of using WMSLayer: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#WmsLayerSimple. Please follow these steps to troubleshoot the layer: http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2009/08/24/Troubleshooting-blank-layers.aspx. Fiddler might be able to show which web request failed.
... View more
12-14-2011
03:33 PM
|
0
|
0
|
2845
|
|
POST
|
I'm not able to reproduce the issue with the following sample. I use a button click event to toggle the position of GroupLayer and I do see Legend control and map reflect the change in layer order. Did I miss anything?
<Grid x:Name="LayoutRoot" >
<esri:Map x:Name="MyMap" WrapAround="True" Extent="-15000000,2000000,-7000000,8000000">
<esri:ArcGISTiledMapServiceLayer ID="Street Map"
Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>
<esri:ArcGISDynamicMapServiceLayer ID="United States" Opacity="0.6"
Url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StateCityHighway_USA/MapServer"/>
<esri:GroupLayer ID="MyGroupLayer">
<esri:FeatureLayer ID="Points of Interest"
Url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Fire/Sheep/MapServer/0" />
</esri:GroupLayer>
</esri:Map>
<Button Content="Test" Click="Button_Click" VerticalAlignment="Top" HorizontalAlignment="Center"/>
<Border Background="#77919191" BorderThickness="1" CornerRadius="5"
HorizontalAlignment="Right" VerticalAlignment="Top"
Margin="20" Padding="5" BorderBrush="Black" >
<esri:Legend Map="{Binding ElementName=MyMap}"
LayerItemsMode="Tree"
ShowOnlyVisibleLayers="False">
<esri:Legend.MapLayerTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<CheckBox Content="{Binding Label}"
IsChecked="{Binding IsEnabled, Mode=TwoWay}"
IsEnabled="{Binding IsInScaleRange}" >
</CheckBox>
<Slider Maximum="1" Value="{Binding Layer.Opacity, Mode=TwoWay}" Width="50" />
</StackPanel>
</DataTemplate>
</esri:Legend.MapLayerTemplate>
<esri:Legend.LayerTemplate>
<DataTemplate>
<CheckBox Content="{Binding Label}"
IsChecked="{Binding IsEnabled, Mode=TwoWay}"
IsEnabled="{Binding IsInScaleRange}" >
</CheckBox>
</DataTemplate>
</esri:Legend.LayerTemplate>
</esri:Legend>
</Border>
</Grid>
</UserControl>
private void Button_Click(object sender, RoutedEventArgs e)
{
var l = MyMap.Layers["MyGroupLayer"] as GroupLayer;
var index = MyMap.Layers.IndexOf(l);
MyMap.MoveLayer(index, index == 1 ? 2 : 1);
}
... View more
12-14-2011
03:30 PM
|
0
|
0
|
509
|
|
POST
|
Are you saying the graphic that enabled EditVertices does not match its original graphic's symbol? How does FeatureLayer determine its symbol? Did you set a renderer or does the service define a renderer? Is the renderer based on a field/attribute? What version of the API are you using?
... View more
12-14-2011
03:18 PM
|
0
|
0
|
512
|
|
POST
|
I'm not sure what you are trying to accomplish. You want to get the polygon geometry? If yes, I added the highlighted code from this SDK sample: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ViewShed
private void GeoprocessorTask_ExecuteCompleted(object sender, ESRI.ArcGIS.Client.Tasks.GPExecuteCompleteEventArgs args)
{
MyMap.Cursor = System.Windows.Input.Cursors.Hand;
GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer;
foreach (GPParameter gpParameter in args.Results.OutParameters)
{
if (gpParameter is GPFeatureRecordSetLayer)
{
GPFeatureRecordSetLayer layer = gpParameter as GPFeatureRecordSetLayer;
foreach (Graphic graphic in layer.FeatureSet.Features)
{
var polygon = graphic.Geometry as Polygon;
graphic.Symbol = LayoutRoot.Resources["DefaultFillSymbol"] as Symbol;
graphicsLayer.Graphics.Add(graphic);
}
}
}
}
... View more
12-14-2011
02:32 PM
|
0
|
0
|
721
|
|
POST
|
Graphic.Attributes is dependent on FeatureLayer.OutFields. Be sure to set FeatureLayer.OutFields.
... View more
12-14-2011
02:24 PM
|
0
|
0
|
1205
|
|
POST
|
To enable paging in your data grid, you need to use PagedCollectionView. You cannot create an instance of PagedCollectionView by passing service url. You need to pass the results of your Query. http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#QueryWithoutMap.
PagedCollectionView pagedCollectionView;
void QueryTask_ExecuteCompleted(object sender, QueryEventArgs args)
{
pagedCollectionView = new PagedCollectionView(args.FeatureSet);
}
... View more
12-14-2011
12:08 PM
|
0
|
0
|
1201
|
|
POST
|
Clicking display attribute button in EditorWidget, will cancel any active command so you cannot use this in combination with Editor.Select command. You can use subscribe to EditorWidget.EditCompleted and use FeatureDataForm instead: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ToolkitFeatureDataForm
void EditorWidget_EditCompleted(object sender, Editor.EditEventArgs e)
{
foreach (var edit in e.Edits)
{
if (edit.Graphic.Selected)
{
myFDF.FeatureLayer = edit.Layer as FeatureLayer;
myFDF.GraphicSource = edit.Graphic;
}
}
}
This seem related to updating cursor: http://forums.arcgis.com/threads/44498-Change-Mouse-Cursor-when-hovering-a-feature
... View more
12-14-2011
11:23 AM
|
0
|
0
|
487
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-10-2026 12:13 PM | |
| 1 | 09-11-2025 01:30 PM | |
| 1 | 06-06-2025 10:14 AM | |
| 1 | 03-17-2025 09:47 AM | |
| 1 | 07-24-2024 07:32 AM |
| Online Status |
Offline
|
| Date Last Visited |
07-13-2026
09:07 AM
|