)
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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Adding custom properties using property bag

Platform: WinForms |
Control: Diagram |
Published Date: November 25, 2015 |
Last Revised Date: June 3, 2019
Tags: diagram

 Adding custom properties in property bag

We can add custom properties to the node and connector by means of property bag. It can be achieved in two ways:

  1. Adding custom properties in code behind:

The custom property can be added by invoking the node’s PropertyBag.Add method.

The below code shows how to add custom properties.

[C#]

 
Syncfusion.Windows.Forms.Diagram.Rectangle rect= new Syncfusion.Windows.Forms.Diagram.Rectangle(10, 10, 10, 10);
 
//Adding Custom Properties for the node in property bag
rect.PropertyBag.Add("InnerRect:",10);
rect.PropertyBag.Add("OuterRect:", 20);
 

 

[VB]

 
Dim rect As New Syncfusion.Windows.Forms.Diagram.Rectangle(10, 10, 10, 10)
 
'Adding Custom Properties for the node in property bag
rect.PropertyBag.Add("InnerRect:",10)
rect.PropertyBag.Add("OuterRect:", 20)
 

 

  1. Adding the custom properties in runtime.

 

  1. Add the PropertyEditor in the diagram.
  2. Select the node to which custom property need to be added.
  3. Select the propertybag in propertyeditor and enter the Name,Type and Value as shown in the image below.

 

 

Adding custom properties in Runtime.

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon