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

Connectors in Symbol Palettes

Hi.
In one of your examples(Export Image) I saw a symbol palette with a connector symbol that when dragged and dropped can connect other symbols in the diagram. How is it done? What proprieties have I to set for a connector in order to obtain such an effect?
Thanks.
Best regards, Frank.

6 Replies

GM Gowri Manohari D Syncfusion Team June 18, 2009 06:40 AM UTC

Hi Frank,

Thanks for choosing Syncfusion procducts.

In order to connect the nodes via connector, we have set the EnableCentralPort property to true for HeadNode and Tail Node of the connector. As well as set the connector.EnableCentralPort to true for exact connection.

Regards,
Gowri


VC Veaceslav Cosulet June 18, 2009 09:01 AM UTC

Sorry Gowri, but where are those proprieties exactly? I can't find them in Symbol Designer -> Proprieties for a connector. Have you meant I have to set those properties in symbol designer for this connector symbol, or in code?
I can't find HeadNode and TailNode properties for the connector and respectively EnableCentralPort property for each of them. connector.EnableCentralPort is set to true by default.
Could you be more explicit?
I want a connector in symbol palette like in your example, so that when dragged and dropped on the diagram it can connect two other symbols.
Thanks.
Best regards, Frank.


GM Gowri Manohari D Syncfusion Team June 22, 2009 03:38 AM UTC

Hi Frank,

Sorry for the inconvenience caused.

I have created sample for your requirement. The sample which I have created is for when dragged and dropped the Connector Symbol from Symbol Palette, will connect the Symbols in a diagram. In order to achieving the above, we should set the 'EnableCentralPort' Property for the Symbols to true.

In our sample we want to connect the Rectangle node and Ellipse node using Connector Symbol. In order to achieving this, we should set the 'EnableCentralPort' Property of Rectangle and Ellipse Symbol to true. And also set the 'EnableCentralPort' Property of Connector Symbol to true in property editor.

For more details please refer the sample.

http://files.syncfusion.com/support/Diagram.Windows/Forums/F82618/main.htm


Regards,
Gowri


GM Gowri Manohari D Syncfusion Team June 22, 2009 03:40 AM UTC

Hi Frank,

Sorry for the inconvenience caused.

I have created sample for your requirement. The sample which I have created is for when dragged and dropped the Connector Symbol from Symbol Palette, will connect the Symbols in a diagram. In order to achieving the above, we should set the 'EnableCentralPort' Property for the Symbols to true.

In our sample we want to connect the Rectangle node and Ellipse node using Connector Symbol. In order to achieving this, we should set the 'EnableCentralPort' Property of Rectangle and Ellipse Symbol to true. And also set the 'EnableCentralPort' Property of Connector Symbol to true in property editor.

For more details please refer the sample.

http://files.syncfusion.com/support/Diagram.Windows/Forums/F82618/main.htm


Regards,
Gowri


VC Veaceslav Cosulet June 23, 2009 10:23 AM UTC

Hi Gowri and thanks.
So creating and adding a symbol connector in a symbol palette is possible only dynamically, Symbol Designer utility has no such possibility? I mean to create and add a symbol connector during designing a symbol palette with Symbol Designer utility. Right?
Because I tried both, adding a symbol connector to a palette with Symbol Designer and another one in code. And in the first case the symbol connector is treated as a symbol with selection area around, and in the second case as a connector with possibility to connect symbols from palette.
Thanks and best regards, Frank.


GM Gowri Manohari D Syncfusion Team June 25, 2009 10:54 AM UTC

Hi Frank,

We can create such connector Symbol in Symbol Designer utility by means of some code changes in Symbol Designer source. Please replace given set of code in the Source File.

In Symbol Designer source file under MainForm.cs , there is a method called “PreparePaletteToSave()”, the method contains the below lines of code for in order to save the Symbol into Palette.

if (nodes.Count > 0)
{
nodeTmp = new Group(nodes);
}
else
{
nodeTmp = null;
}

Please replace the above set of code with the below lines in “PreparePaletteToSave()” method.

if (nodes.Count > 1)
{
nodeTmp = new Group(nodes);
}
else if (nodes.Count > 0)
{
nodeTmp = nodes.First;
}
else
{
nodeTmp = null;
}
Run the sample and try to create the connector symbol in Symbol Designer, it will meets your requirement.

Regards,
Gowri

Loader.
Live Chat Icon For mobile
Up arrow icon