Select to view content in your preferred language

Customized Feature data form

468
1
08-24-2012 01:52 PM
TanyaOwens
Frequent Contributor
Hello,

I used the following sample to create a feature data form: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#ToolkitFeatureDataForm.

Is it possible to customize the form to allow for aliases of the attribute fields and add in clear text on click in the text box area? If so, is there an example on how to do this? I don't see how to even start with the sample above.

I am using API 2.4 and SL4

Thanks!!
0 Kudos
1 Reply
TanyaOwens
Frequent Contributor
I have a work around with the field alias by creating the alias in ArcMap before publishing the service (although I would really like to know how to create an alias in the code for Feature Data Forms).

I am working on having the text clear in the text boxes in the Feature Data form. I added got focus but I am getting the following error:
"InvalidCastException was unhandled by user code - Unable to cast object of type 'ESRI.ArcGIS.Client.Toolkit.FeatureDataForm' to type 'System.Windows.Controls.TextBox'."

Below is my code:

xaml:
                <esri:FeatureDataForm x:Name="MyFeatureDataForm" 
                                  FeatureLayer="{Binding Path=Layers[BikeCount], ElementName=Map}"
                                  IsReadOnly="False" LabelPosition="Left" GotFocus="TextBox_GotFocus"/>


C#:
        public void TextBox_GotFocus(object sender, RoutedEventArgs e)
        {
            TextBox tb = (TextBox)sender;
            tb.Text = string.Empty;
            tb.GotFocus -= TextBox_GotFocus;
        }


I am not sure how to go about fixing this.
0 Kudos