Dividing Diagram into Regions

I would like to know if a diagram can be divided into regions for different types of nodes so that only nodes of that type can be dropped there. The regions I envision are vertical regions.

1 Reply

J. J.Nagarajan Syncfusion Team September 18, 2007 08:36 PM UTC

Hi Antonio,

Thank you for your interest in Syncfusion product. In the present scenario of Diagram architecture we could not divide a diagram model into multiple region. However we can add multiple diagram models and we can view as a different region. To perform a particular node dropping please refer to the following code snippet

[C#]

this.diagram1.Controller.Model.EventSink.NodeCollectionChanging += new CollectionExEventHandler(EventSink_NodeCollectionChanging);
this.diagram2.Controller.Model.EventSink.NodeCollectionChanging+=new CollectionExEventHandler(EventSink2_NodeCollectionChanging);

void EventSink_NodeCollectionChanging(CollectionExEventArgs evtArgs)
{
if (evtArgs.Element is Syncfusion.Windows.Forms.Diagram.Ellipse)
{
Console.WriteLine("Working");
}
else
{
evtArgs.Cancel = true;
}
}

private void EventSink2_NodeCollectionChanging(CollectionExEventArgs evtArgs)
{
if (evtArgs.Element is Syncfusion.Windows.Forms.Diagram.Polygon)
{
Console.WriteLine("Working");
}
else
{
evtArgs.Cancel = true;
}
}


I have attached the sample that demonstrates this completely. In this sample you can drag drop only the Ellipse node in Diagram1 and the Diagram2, the polygon in Diagram2. You can download the sample from the following page.

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

Please refer to the sample and let me know if this helps.

Regards,
Nagaraj

Loader.
Up arrow icon