Hi!
I've a problem with the above mentioned control style. There's a few grids nested in the control template for the xamDataTreeNodeControl and all have their HorizontalAlignment set to "Stretch". The problem is that the innermost grid isn't stretched to take all the available space it has.
Any help is much appreciated.
Thanks!
Hi,
Do you think you can post your custom ControlTemplate so that I have a better idea on what exactly is going wrong?
Thanks,
-SteveZ
I've included a sample project below. What i would like to have is the "main" grid to be stretched to take up all the space it has. But even if every grid has HorizontalAlignment set to "Stretch" it still doesn't work. If you run the sample you can see the light blue color not being stretched. If you hardcode the width value however it works (but that is not an option).
Just wondering if you've had the time to check the sample/work out a solution? The problem is still persisting.
So, you're not really going to be able to control this through a style. The width of each node is handled by the NodesPanel of the xamDataTree.
I'm not 100% sure what you're looking for, but i guess you could potentially create your own NodesPanel that derives from outs and override the RenderNode method, and set the width of the node and re-measure it.
Note: this would really be the only way to handle this, b/c we don't expose a way to override the Arranging of a node, without rewriting the entire arrange logic, which i wouldn't recommend doing:
public class CustomNodesPanel : NodesPanel
{
protected override Size RenderNode(Infragistics.Controls.Menus.XamDataTreeNode node, double availableWidth)
base.RenderNode(node, availableWidth);
if (node.Control != null)
if(!double.IsPositiveInfinity(availableWidth))
node.Control.Width = availableWidth;
node.Control.Measure(new Size(availableWidth, double.PositiveInfinity));
}
return node.Control.DesiredSize;
Then you can change the XamDataTree ControlTemplate to use your CustomNodesPanel
Here is an example of the xaml, and a modified version of your NodeTemplates
Hope this helps,
Works fine! Thanks for the help :)
The CustomNodesPanel works great for having the top hierarchy node expand to fill the width of the XamDataTree. However, I also want the second hierarchy level nodes to expand to the fill the width. How can I accomplish the same thing on the second level of nodes.