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

how to define custom controls in the Syncfusion diagram and then read it, and few queries regarding diagram tool ?

Hi ,

We want to develop and processing pipe line solution for a chemical factory; in the same the user want's a dashboard kind of place where he had a left panel where he can define the custom shapes and control's . he can drag and drop them on processing board( on right panel) and do the following

1. can save the processing diagram and later open it.
2. can add custom win forms for saving properties with each custom defined control and connectors too
3. can read all those custom defined control's and its properties.
4. if yes then how ? is there any sample project is available for it / code .

We are in process of evaluating the tools for purchase, please let us know if its possible with syn fusion and if yes then can you provide sample code.

Regards',
Hemant S




1 Reply

NG Naganathan Ganesh Babu Syncfusion Team March 20, 2015 07:14 AM UTC

Hi Hemant,

Thanks for using Syncfusion product.

can save the processing diagram and later open it?

Yes, you can use diagram.LoadBinary() and diagram.SaveBinary() method to load and save the diagram file. Please refer the below code snippet and dashboard location for your reference.

Here is the code snippet:

string filepath = ".../.../.../WindowsFormsApplication2/sample.edd";

//Load diagram file

diagram1.LoadBinary(filepath);

//Save diagram file

diagram1.SaveBinary(filepath);

Here is the dashboard location:

...\My Documents\Syncfusion\EssentialStudio\VersionNumber\Windows\Diagram.Windows\Samples

can add custom win forms for saving properties with each custom defined control and connectors too?

Could you please share us more information about your requirement probably screenshot or video which will help us to analyze further and provide you a better solution?

can read all those custom defined control's and its properties?

Could you please let us know whether your actual intention is to use other windows controls in diagram or not? If so, please use our ControlNode in order to use other controls in diagram. If not, please share us more information probably a screenshot or video, this will help us to analyze further and provide better solution.

Here is the code snippet:

//initialize button

ButtonAdv btn = new ButtonAdv();

btn.Text = "Click to activate me";

btn.UseVisualStyle = true;

btn.UseVisualStyleBackColor = true;

btn.Office2007ColorScheme = Office2007Theme.Blue;

btn.Appearance = ButtonAppearance.Office2007;

btn.Click += new EventHandler( btn_Click );

//initialize control node with button

ControlNode ctrlnode = new ControlNode( btn, new RectangleF( 100, 200, 150, 50 ) );

ctrlnode.ActivateStyle = ActivateStyle.ClickPassThrough;

this.diagram1.Model.AppendChild( ctrlnode );

Here is the dashboard sample location in your machine:

...\My Documents\Syncfusion\EssentialStudio\ VersionNumber\Windows\Diagram.Windows\Samples\Getting Started\ Controls Galore

Please let us know if you have any concern.

Regards,

Naganathan K G


Loader.
Up arrow icon