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. Image for the cookie policy date

Diagram Node Auto Height

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?

5 Replies

SC Sudhakar C Syncfusion Team 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.

 

Regards,

 

Sudhakar C



NodeContentAsButton_f5f15ab.zip


MM Mathieu Myrand Bolduc 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?


SC Sudhakar C Syncfusion Team 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.

 

Regards,

 

Sudhakar C



Image_fd20217a.zip


MM Mathieu Myrand Bolduc 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}"/>
            </Style>

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


SC Sudhakar C Syncfusion Team 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. 

Regards,

 

Sudhakar C


Loader.
Live Chat Icon For mobile
Up arrow icon