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

User-assigned name to node

I've noticed that when user drags and drops nodes onto the diagram, it automatically generates their names in that order:
ControlNode1
ControlNode
ControlNode2
ControlNode3

I want to know whether there is a way for the user to assign a name to it (e.g via a textbox input in a popup dialog) instead of having the default names, and having to change them each time afterwards.

If so, how?

Cheers


3 Replies

AD Administrator Syncfusion Team November 18, 2008 11:29 AM UTC

Nvm. I figured it out. Starting to understand how this stuff works.

[code]
Dim ctrlnode As ControlNode = New ControlNode(btn, New RectangleF(100, 200, 150, 50))
ctrlnode.Name = TextBox1.Text
Me.Diagram1.Model.AppendChild(ctrlnode)
[/code]



AD Administrator Syncfusion Team November 18, 2008 11:49 AM UTC

@Beginner:
----------
Hi Beginner,

The user assigned name can be given to your controls (nodes) as and when they are dropped to the diagram; but programmatically.

I am attaching my sample file herewith, that asks for a name and when the user types the name, it gets assigned to your Nodes.

Update me of your experiences and keep posting your comments.

--X--

@Ameel:
-------
The code snippet is just right!

Keep up the good work and keep coding smart!

--X--

Thanks for your interest in Syncfusion Products.

Happy Coding!

- Ajeet



AD Administrator Syncfusion Team November 18, 2008 12:19 PM UTC

@Beginner:
----------
Hi Beginner,

The user assigned name can be given to your controls (nodes) as and when they are dropped to the diagram; but programmatically.

I am attaching my sample file herewith, that asks for a name and when the user types the name, it gets assigned to your Nodes.

Update me of your experiences and keep posting your comments.

--X--

@Ameel:
-------
The code snippet is just right!

Keep up the good work and keep coding smart!

--X--

My Sample file here at:
----
http://websamples.syncfusion.com/samples/Diagram.Windows/F77810A/main.htm
----

Thanks for your interest in Syncfusion Products.

Happy Coding!

- Ajeet


Loader.
Live Chat Icon For mobile
Up arrow icon