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
close icon

Changing the polyline default name

hello,
I have an application in wich i must give each node drawed in the diagram a default name.
When using the polyline tool, and when drawing is finnished, it gives to the node the default name PolylineNode, and then polylineNode1 and so on..
I want to be able to change this fact and give the drawed node a default name : Room1, then Room2 and so on?
how can this be done, and wich methods i have to use.. thanks a lot .
Elia

1 Reply

AJ Ajish Syncfusion Team August 24, 2007 07:55 PM UTC

Hi Elia,

Thank you for your interest in syncfusion products.

You can change the polyline default name is can be done by overiding the PolyLineBase Class CreateNode(). Here is the code for doing it,

>>>>
static int i = 0;
protected override Node CreateNode( PointF[] pts )
{
LineBase toReturn = new PolylineNode( pts );
SetDecorator( toReturn );
i++;
toReturn.Name = "Room" + i.ToString();

return toReturn;
}
>>>>

Here is the sample link for your refference,

Sample: http://websamples.syncfusion.com/samples/Diagram.Windows/F67602/main.htm

Kindly take a look and let me know if you need further assistance.

Regards,
Ajish.

Loader.
Live Chat Icon For mobile
Up arrow icon