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.
Unfortunately, activation email could not send to your email. Please try again.

progammatically add a symbol from the palette

Thread ID:

Created:

Updated:

Platform:

Replies:

74628 Jun 23,2008 11:53 AM Jun 25,2008 03:03 AM Windows Forms 2
loading
Tags: Chart
Peter Mcintosh
Asked On June 23, 2008 11:53 AM

Please can you tell me how to add a symbol from the palette via code.

Ultimately, i want to populate a context menu (via right click mouse button) with each of the items from the palette and allow the user to add nodes from this.

The Help contains the following which i guess must be out of date:

How can I progammatically add a symbol from the palette?

The following code sample demonstrates how you can progamatically add a symbol from the symbol palette to a Diagram.


[C#]

//New InsertNodesCmd
InsertNodesCmd insCmd = new InsertNodesCmd();

//Select the Symbol from the PaletteGroupView
this.paletteGroupView1.SelectSymbolModel(this.paletteGroupView1.GroupViewItems[1].Text);
SymbolModel symModel = this.paletteGroupView1.SelectedSymbolModel;

//New NodeCollection
NodeCollection nodes = new NodeCollection();

//Add Symbol to the NodeCollection
if (symModel != null)
{
Symbol triangle = symModel.CreateSymbol();
nodes.Add(triangle);

}
insCmd.Nodes.Concat(nodes);
insCmd.Location = new PointF(125,125);
//ExecuteCommand to add the Symbol
this.diagram1.Controller.ExecuteCommand(insCmd);






Peter Mcintosh
Replied On June 24, 2008 04:48 AM

Sorry, this has been posted in the wrong forum. I have added this post to the diagrams forum.



Manohari [Syncfusion]
Replied On June 25, 2008 03:03 AM

Hi,

Thanks for the update. And Thanks for your interest in Syncfusion products.

Regards,
Manohari.R


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;