Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
185
XamDataTree - Problems binding NodeLayout to a dictionary
posted

Hey,

I would like to implement Infragistic's XamDataTree but I'm having a problem with binding a NodeLayout to a dictionary.

One of my Items in the Hierarchy holds a property of a dictionary, which I'd like to bind the DataTree's Node Layout too. Actually, to be more specific, I only need to bind the NodeLayout to the dictionary's values list.

However, when I try doing that with this markup

<Infragistics:NodeLayout Key="Fields" TargetTypeName="FieldMetaData" DisplayMemberPath="Values.FieldName"/>

I get this error in my debug output when trying to expand its parent node, to see this exact node layout - 

"Unable to cast object of type 'System.Collection.Generic.KeyValuePair`2[FieldMetaData]' to type 'System.String'.

 

I tried many other tricks and variation that unfortunately didn't work. Also, apparently TargetTypeName does nothing in this case since I guess it doesn't recognize the values as "FieldMetaData" type, so only "Keys" actually works.

So I wonder if XamDataTree even supports dictionaries, or if there's anyway to make it work because all I actually need is to bind to the list of Dictionary values.

In Microsoft's regular TreeView It worked, so it will be a bit disappointing if I couldn't make this work with XamDataTree.

 

Thanks!

 

Dror.