Select to view content in your preferred language

FeatureDataForm missing FeatureLayer property?

3250
8
11-02-2010 07:52 PM
Alaind_Espaignet
Emerging Contributor
Is anyone else not seeing the FeatureLayer property in FeatureDataForm?

I copy this from the samples

            <esri:FeatureDataForm x:Name="MyFeatureDataForm"  
                                         FeatureLayer="{Binding Path=Layers[PointLayer], ElementName=MyMap}"
                                         IsReadOnly="False" LabelPosition="Left" />

And I get FeatureLayer is not a property of FeatureDataForm!
I have xmlns:esri="http://schemas.esri.com/arcgis/client/2009"
I am referencing ESRI.ArcGIS.Client and ESRI.ArcGIS.Client.Toolkit both 2.0.0.243
0 Kudos
8 Replies
AliMirzabeigi
Emerging Contributor
I am not able to reproduce this problem. Have you tried to use the following XML name space instead?

xmlns:esriToolkit="clr-namespace:ESRI.ArcGIS.Client.Toolkit;assembly=ESRI.ArcGIS.Client.Toolkit"


You should also use "<esriToolkit:FeatureDataForm ..." in the body of your application.
0 Kudos
JenniferNery
Esri Regular Contributor
I was only able to replicate the error (The property 'Featurelayer' was not found in type 'FeatureDataForm') when I have incorrectly named the property.  It is case-sensitive.  However, the code you posted has the correct casing and spelling.

If it was not able to find FeatureDataForm, the error would be different. If the Binding statement was wrong, the SL app will still compile but have an empty FeatureDataForm.
0 Kudos
Alaind_Espaignet
Emerging Contributor
Thanks for looking into this. Here is some more info/behavior.

As suggested I tried using
xmlns:esriToolkit="clr-namespace:ESRI.ArcGIS.Client.Toolkit;assembly=ESRI.ArcGIS.Client.Toolkit"
instead of the usual esri
Behavior is the same I get HRESULT E_FAIL calling COM component error as soon as I drop the FeatureDataForm in my XAML. Does not matter if I pick it from the controls toolbox or type it in I get the same error.
I close the XAML and re-open it again the COM error goes away.
But as you can see in the images FeatureLayer is not an available property.
This is really odd. I am using ESRI controls all over this app including FeatureDataGrid.
I looked at the source code on codeplex and did not see any public exposed FeatureLayer property. There is one but it is private. Unless I am mistaken looking at the code the FeatureLayer property seems missing/not exposed. Yet the ESRI samples using this control works fine.
So for now no feature editing 😞 I looked at the code, I could roll my own but would be nice to know if someone else is having this problem. What else could go wrong I am worried now. So far I had zero problems using ESRI Silverlight SDK v 2.0 + SL4 + VS2010.
See the pics attached.  No FeatureLayer property in the properties window!

Thanks
0 Kudos
JenniferNery
Esri Regular Contributor
We are aware of the COM component error as reported in this thread: http://forums.arcgis.com/threads/15925-Except-Map-and-scalebar-all-controls-fail to resolve this you need to add a reference to System.Windows.Controls.Data.Input before dragging the control to your design.

But what I have not seen yet is the "FeatureLayer was not found in type FeatureDataForm" error.  If you did not drag and drop FeatureDataForm to your design, and instead add reference only to the following assemblies: ESRI.ArcGIS.Client.dll and ESRI.ArcGIS.Client.Toolkit.dll, and then add the following code in your XAML, do you get the error?
xmlns:esri="http://schemas.esri.com/arcgis/client/2009">
    <Grid x:Name="LayoutRoot" >
<!-- more code goes here -->
        <esri:FeatureDataForm FeatureLayer="{Binding Path=Layers[PointLayer], ElementName=MyMap}" />
    </Grid>
0 Kudos
Alaind_Espaignet
Emerging Contributor
Added System.Windows.Controls.Data.Input

Drag toolbox to design surface - The Extender Provider failed to return an Extender for this object.

Type <esriToolkit:FeatureDataForm /> - Error HRESULT E_FAIL has been returned from a call to a COM component.

Either way still no FeatureLayer property.
0 Kudos
JenniferNery
Esri Regular Contributor
Can you try another thing?  Start a brand new Silverlight application in Visual Studio 2010 (Silverlight 4, .NET Framework 4.0). Add reference to .NET Assembly System.Windows.Controls.Data.Input. Do not add any namespace in your XAML just yet but go to the Toolbar and drag FeatureDataForm to your Design.  The following should be automatically added to your XAML after the drag is complete.  Go to the properties window and see if you can set FeatureLayer property.

xmlns:esri="http://schemas.esri.com/arcgis/client/2009">
...
<esri:FeatureDataForm/> 
0 Kudos
Alaind_Espaignet
Emerging Contributor
Jennifer,

Bingo, that does it. I created a new Silverlight 4.0 application Framework 4.0, added System.Windows.Data.Input reference,  dragged FeatureDataForm from the toolbar and...

- No COM errors.
- Now I see the FeatureLayer property.

What does that mean though in terms of my solution?

Obviously ESRI Silverlight SDK is installed correctly and works fine when the dll's are referenced from the install folders i.e. Program Files\....

For my solution I normally create a subfolder called Dependencies with subfolders within for each third party dll's I am using. I copied ESRI's dlls from the install folder to ESRI subfolder and I reference dlls from there in my solution. The reason I do this is to the third party dlls end up in my version control system so my solution is tied to the right version dlls it references. Also it helps when sharing code with others working on the project. With one checkout they get all the dependencies.

Could this be the problem?
Should I reference ESRI dlls from their installed locations instead?
Is there a difference between doing this as opposed to what I am doing?
Something to do with ESRI dlls going to the GAC?

Very strange still, as my approach works for all the other third party dlls I reference.
But I'll change all my references to the installed location if need be to get going on the project.
Should I? I am going to try the same thing you suggested in the context of my solution and let the tool pick where it gets the dlls from and see what happens.

Thanks
0 Kudos
Alaind_Espaignet
Emerging Contributor
Jennifer,

I confirm that indeed referencing ESRI dlls from

C:\Program Files\ESRI SDKs\Silverlight\v2.0\ESRI.ArcGIS.Client.dll etc...

as the tooling does it automatically as opposed to manually referencing them from a copy in my References\ESRI folder solves the problem and I can see the FeatureLayer property.

I guess there is no point in fighting it if that's what I have to do to make it work!

Thanks
0 Kudos