Hello,
I'm currently using a XamDataTree and I would like the following functionality:
When there isn't enough space for the text in the XamDataTree I would like the text in the labels to wrap (multiple lines).
Is this possible and how can I achieve this? I've attached an example project.
You can use the ItemTemplate property of the NodeLayout to a DataTemplate which contains a TextBlock with a set width and the TextWrapping property set to Wrap:
<ig:NodeLayout Key="ChildLayout" TargetTypeName="Product" >
<ig:NodeLayout.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Data.ProductName}" TextWrapping="Wrap" Width="90"/>
</DataTemplate>
</ig:NodeLayout.ItemTemplate>
</ig:NodeLayout>
Let me know if you have any questions.
Sincerely,
Valerie
Developer Support Supervisor - XAML
Infragistics
www.infragistics.com/support
Hello, Valerie!
I used your WidthConverter to wrap text in the attached simple example, and faced with the following problem:
If I add a new element to the collection when the text is not transferred to the next line,the new node is marked as active, and automatically scrolled into the visible area.
However, if the text in any of the nodes is wrapped, the node is added it does not appear in the visible area.
Help me please.
--
Alex
Your solution works perfectly when I implement it in a separate project. I used a ValueConverter and a binding to the width of the texblock so the wrapping depends on the width of the XamDataTree. Now I'm trying to integrate it within the 'real' project.
The XamDataTree is now contained in a Grid --> UserControl --> ContentControl --> ContentPane --> SplitPane --> XamDockManager.
At this point setting the width of the textblock doesn't change anything (the textblock keeps a standard size) nor does the binding. The SizeChanged event is activated on the XamDataTree though, so It seems that the containers of the XamDataTree don't have an effect.