Select to view content in your preferred language

How to set some attributes readonly for FeatureDataForm?

719
1
01-05-2011 08:05 AM
XiujuZhou
Emerging Contributor
I have silverlight 4/acrGIS API 2 application. I need to set some attributes readonly for FeatureDataForm. I have not found any place in feature service to implement it. Please help. Thanks.
0 Kudos
1 Reply
dotMorten_esri
Esri Notable Contributor
Your simplest option is to not retrieve the fields from the service in the first place, however that will also mean those fields won't show at all.
Alternatively you will have to create your own FeatureDataForm. It's really just a set of textblocks and textboxes in a grid that two-way binds straight to the attributes of a selected graphic.
ie.
 
<StackPanel x:Name="myForm">
   <TextBlock Text="{Binding Attributes["ObjectID"]" />
   <TextBox Text="{Binding Attributes["Name"], Mode=TwoWay}" />
</StackPanel>
...
private void ShowAttributes(Graphic g)
{
     myForm.Visibility=Visibility.Visible;
     myForm.DataContext = g;
}
0 Kudos