Articles in this section
Category / Section

Adding custom properties using property bag

1 min read

 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.

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied