We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Diagram Node Auto Height

Thread ID:





110500 Aug 7,2013 02:38 PM UTC Aug 14,2013 11:37 AM UTC WPF 5
Tags: Diagram
Mathieu Myrand Bolduc
Asked On August 7, 2013 02:38 PM UTC

Good day,

I tried setting a node Height to Auto, but it clips both the node label or the node content that is assigned.  It basically does not properly adjust to the size of the content.  I also tried using a CustomShape and the same thing happens.  Is it supposed to work like this or is it a bug?

Sudhakar C [Syncfusion]
Replied On August 9, 2013 07:10 AM UTC

Hi Mathieu,


To stretch the width and height of the Node with respect to the content of the Node,  we are suggested you to please set the Width and Height of the Node as NAN (before set the content to the Node) instead of set as Auto. And also, in this scenario after changed the content of the Node, please set the width and height value as ActualWidth and ActualHeight of the Node. Because, we are performing many Node operations based on the Width & Height of the Node for example, Resize, Move, etc. Now, when we try to set the content of the Node, the size of the Node will be stretched to size of the Content.


We have created simple sample for your reference. In that sample, we have button named “Replace”. When we click that Node, all the selected Nodes content will be changed to Button. For more information, please refer the attached sample.


Please let us know if you require further assistance on this.




Sudhakar C


Mathieu Myrand Bolduc
Replied On August 9, 2013 02:41 PM UTC

Thank you very much for the answer.  It is exactly what I needed.  Could that be considered as a bug and added to the Diagram bug list?

Sudhakar C [Syncfusion]
Replied On August 12, 2013 09:36 AM UTC

Hi Mathieu,


This is not an diagram issue. This is a default framework behavior. For more information please refer the below example.


Example : consider the button and set any content of the Button (Assume content width & height is 200,200).


If we set the Width and Height of the Button as NAN, the size of the Button will be stretched based on the size of the Node.  (Or) If we set the Width and Height of the Button as 100,100, the content will be clipped in to the Button.


For more information please refer the attached image. In that image, we have created a button with the content of textbox.


Please let us know if you have any concerns on this.




Sudhakar C


Mathieu Myrand Bolduc
Replied On August 12, 2013 01:39 PM UTC

My apologies, I encountered a situation where my nodes would not properly resize when I set the Height property to Auto, as shown below.  The problem however was that the content was set to a string with a value of " ".  I did not realize that the content was incorrect because the node properly displays the ContentTemplate, but does not set the content.  My request to add a bug was made because it seemed like the node was not properly reacting to the Auto value and not because I thought that the Height = double.NaN was a bug.

<Style TargetType="{x:Type syncfusion:Node}" x:Key="{x:Type syncfusion:Node}">
                <Setter Property="Height" Value="Auto"/>
                <Setter Property="Width" Value="100"/>
                <Setter Property="PortVisibility" Value="AlwaysVisible"/>
                <Setter Property="ContentTemplate" Value="{DynamicResource NodeDataTemplate}"/>

I will open an incident concerning the content bug.  Thank you for your time

Sudhakar C [Syncfusion]
Replied On August 14, 2013 11:37 AM UTC

Hi Mathieu, 

We have updated the response for your query through the incident # 111755 in Direct Track. For more information please refer that incident. 



Sudhakar C


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon