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

Event of end typing annotation text

Hi Ali,
 
The problem i had using EventSink  "NodeCollectionChanged" is that the event was handled before i type the text in the textbox so the TextNode was always empty.
Any suggestion on how to fix this ?

I would like also to associate the annotation (TextNode) to a graphic node so if i select a graphic element in the diagram and try to associate to it a textNode, the selected graphic element was not really selected (diagram.Controller.SelectionList was null).
Any help, please ?
 
Thanks in advance & kind regards,
Rabah TOULAÏT

1 Reply

AA Amsath Ali M Syncfusion Team May 22, 2013 11:30 AM UTC

Hi Toulait,

 

Thanks for your interest in Syncfusion products.

 

1. The problem i had using EventSink  "NodeCollectionChanged" is that the event was handled before i type the text in the textbox so the TextNode was always empty.

Any suggestion on how to fix this?

We Are Glad To Inform You That We Have Achieved Your Requirement In The Below Attached Sample. Please Refer The Below Code Snippet To Resolve The Reported Issue.

 

Here Is The Code:

[C#]

void EventSink_NodeCollectionChanged(CollectionExEventArgs evtArgs)

        {

            if (evtArgs.ChangeType == CollectionExChangeType.Insert)

            {

                if (evtArgs.Element is TextNode)

                {

                    //Peform your actions

                    TextNode curNode = evtArgs.Element as TextNode;

                    if (diagram1.Controller.TextEditor.IsEditing)

                        diagram1.Controller.TextEditor.EndEdit(true);

                    curNode.Text = "TextNode";

                    diagram1.Controller.TextEditor.BeginEdit(curNode, false);

                }

            }

        }

2. I would like also to associate the annotation (TextNode) to a graphic node so if i select a graphic element in the diagram and try to associate to it a textNode, the selected graphic element was not really selected (diagram.Controller.SelectionList was null).

 

Any help, please?

Could you please share us more information probably images which clearly shows the reported issue, this will help us to investigate further and to provide a better solution to you?

 

 

Please let us know if you have any queries.

 

Regards,

Amsath Ali. M



F108838_46385ba3.zip

Loader.
Live Chat Icon For mobile
Up arrow icon