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

Orthogonal connector and editable lablel

Thread ID:

Created:

Updated:

Platform:

Replies:

104688 Aug 9,2012 07:03 AM UTC Nov 2,2012 12:56 PM UTC WinForms 14
loading
Tags: Diagram
Klaudiusz Bryja
Asked On August 9, 2012 07:03 AM UTC

Hi,

I have custom connector which inherits from OrthogonalConnector. I have to add label for this connector but:
1. I can only add label which is not editable. I need solution where on double click in label I can edit this label. I need solution like child node of TextNode type in group node.
2. This label is placed in diagram with some additional spaces which is vary depending on how connector has points. Look at
Orthogonal.png attachment. I need solution similar to direct line connector where label is placed on line (look at direct.png attachment).

Is it possible to achive my needs?


connector_ac9d332d.zip

Pandi Murugan A [Syncfusion]
Replied On August 13, 2012 11:14 AM UTC

Hi Bryja,

 

Thanks for using Syncfusion products.

 

The Label has “Position” property to align it with predefined values and it is "Center" by default. We suggest you to use this property for your requirement.

 

<Code>

[C#]

Syncfusion.Windows.Forms.Diagram.Label lbl = new Syncfusion.Windows.Forms.Diagram.Label();

//positioning lbl

lbl.Position = Position.TopCenter;

</Code>

 

Also, the Label has OffsetX/OffsetY for custom positioning and you can use this too.

 

Please let me know if any concerns.

 

Regards,

Pandi Murugan A


Klaudiusz Bryja
Replied On August 22, 2012 05:39 AM UTC

Hi,

1. Label position - I use this property but I have to calculate position and when using orthogonal connector it is not easy. I hope you have solution for this.
2. What about editable label for connector? Any solution/help for me in this topic?



Klaudiusz Bryja
Replied On August 28, 2012 08:48 AM UTC

Any progress in my questions? We need this answers so please answers us.

Best regards,
Klaudiusz

Pandi Murugan A [Syncfusion]
Replied On August 28, 2012 12:44 PM UTC

Hi Bryja,

 

Thanks for the update.

 

1.       You can use the below solution for your requirement.

 

Solution

 

2.       The latest version of Essential Diagram supports editing the label in place by clicking on a node. Could you please upgrade to the latest version?

 

Please let me know if any concerns.

 

Regards,

Pandi Murugan A


Klaudiusz Bryja
Replied On August 29, 2012 07:26 AM UTC

Hi,

1. I think it is great solution
2. We use Essential Studio v.10.2.0.75 so not latest. You say that I should use v10.3.0.43?

Best regards
Klaudiusz

Pandi Murugan A [Syncfusion]
Replied On August 29, 2012 12:25 PM UTC

Hi Bryja,

 

Thanks for the update.

 

2. You can get a separate patch for the feature “In place label editing” in your current version from us. Or, you can upgrade to the latest version.

 

Please create a DirectTrack incident if you need a patch for the requested feature in your current version so that we can update the patch for the same. You can create the DT incident from the following link.

 

http://www.syncfusion.com/account/dashboard

 

In the interests of maintaining confidentiality, we have a policy of not sharing patches or otherwise proprietary customer specific information in the public forum.  

 

Please let me know if any concerns.

 

Regards,

Pandi Murugan A


Klaudiusz Bryja
Replied On September 10, 2012 08:53 AM UTC

Hi,

Than you for help. I install version 10.3.0.43 and look at editable lables. I have questions for you:

Now when we double click on connector we open form. I notice that I have to double click on connector to start edit label (when I click on label text selection was removed and editor not start). Is it possible to check (I derive from OrthogonalConnector class) if I double click label/connector and manually run editor tool? In taht case when we click on connector we run our form but when we click on label we start edit label (attached picture explain this topic).

Is it possible to remove text formatting from label editor? I mean we don't want to allow users to change fonts on lables so we want only text box (attached picture - I draw frame in green on this part which we don't want to show our user).

Best regards,
Kludiusz


editor_53f2c32a.zip

Amsath Ali M [Syncfusion]
Replied On September 12, 2012 11:37 AM UTC

Hi Bryja,

 

Thanks for your update.

 

Currently we don’t provide support to “Remove the text formatting from label editor”. This has been suspected to be a feature request. Please create a DT incident for your query so that we can update the patch for this feature.

You can create the DT incident from the following link.
http://www.syncfusion.com/account/dashboard

In the interests of maintaining confidentiality, we have a policy of not sharing patches or otherwise proprietary customer specific information in the public Forum.

Please let us know if you have any queries.

Regards,
Amsath Ali. M


Klaudiusz Bryja
Replied On October 4, 2012 08:51 AM UTC

Hi Amsat,

Thanks for halp. Everythink works fine.

Best regards,
Klaudiusz

Klaudiusz Bryja
Replied On October 8, 2012 12:56 PM UTC

Hi,

I have one more question about connectors. We want to store diagram look in database so I overwrite:
UpdateGraphicsPath(PointF[] pts) method and serialize PinPoint and graphics path of the connector in xml in database. When open stored diagram I try to restore points (which looks properly in our xml) using SetPoints(p, true) metohod.
On nodes we have EnableCentralPoint  set to true. We have two situations:
1. Everything works fine (when nodes are connected like in attached file 1.png)
2. When nodes are connected like in 2.png file - path is restored properly (I mean line segments) but starting/ending point is moved. I noticed that this offset is increasing everytime I save diagram.

How to properly store points for connector and how to set node properties to have possibilities conect line where I want to (not only in middle of node width/height).

Best regards,
Klaudiusz


attach_f6d1232b.zip

Klaudiusz Bryja
Replied On October 11, 2012 09:48 AM UTC

Hi,

Any answers for us?

Best regards,
Klaudiusz

Amsath Ali M [Syncfusion]
Replied On October 11, 2012 11:22 AM UTC


Klaudiusz Bryja
Replied On October 31, 2012 02:29 PM UTC

Hi,

Thank you for help. It is waht I was thinkig of. Main problem is that in this solution when you try to exchange two nodes positions connector will be sticked to Connector points (so line will cross through node like in situation 2 in attached image). Is It possible to recalc line that in that situation connector point change his position to nearest edge (like in situation 3)?

Best regards,
Klaudiusz


1_a0da1170.zip

Amsath Ali M [Syncfusion]
Replied On November 2, 2012 12:56 PM UTC

Hi klaudiusz,

 

Thanks for your update.

 

In general, when a connector is connected to the centralPort of a node, then it will automatically change the docking position to the nearest edge of the node. But, when it is connected to a particular connectionPoint then it is always stick to the location of that connectionPoint and the docking position also not be changed.

However you can achieve your requirement by changing the connectionPoints from which that connector connected while exchanging the node’s position. Please refer the below code snippet to achieve your requirement.

 

Here is the code:

[C#]

 

//reconnecting connector with updated enpoints

private void exchangeNodePostionToolStripMenuItem_Click(object sender, EventArgs e)

        {

            diagram1.Model.BeginUpdate();

            PointF temp = diagram1.Model.Nodes[0].PinPoint;

            diagram1.Model.Nodes[0].PinPoint = diagram1.Model.Nodes[1].PinPoint;

            diagram1.Model.Nodes[1].PinPoint = temp;

 

            if (diagram1.Model.Nodes[2] is ConnectorBase)

            {

                diagram1.Model.Nodes[0].Ports[0].Connect(((ConnectorBase)diagram1.Model.Nodes[2]).HeadEndPoint);

                diagram1.Model.Nodes[1].Ports[1].Connect(((ConnectorBase)diagram1.Model.Nodes[2]).TailEndPoint);

            }

            diagram1.Model.EndUpdate();

        }

 

Here is the sample:

F104688.zip

 Please let us know if you have any queries.

 

Regards,

Amsath Ali. M



F104688_f5275ceb.zip

CONFIRMATION

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.

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

;