Custom Property Editor. Show only name of node
Thanks for contacting Syncfusion support.
|
By default, diagram’s property container which displays all properties of the diagram’s nodes while assigning the diagram into the PropertyEditor’s “Diagram”. If you want to display custom property of the node, please create the PropertyGrid instead of PropertyEditor and use the PropertyGrid’s “Selectedobject” property to display the custom property of the node.
Please refer to the attached code example and sample. |
Code example:
[C#]
Node node = evtArgs.Element as Node; if (node.PropertyBag.Keys.Count == 0) { node.PropertyBag.Add("Name", node.Name); } if (node.PropertyBag.Keys.Count > 0) { CommonProperties properties = new CommonProperties(); properties.Name = node.PropertyBag["Name"].ToString(); propertyGrid1.SelectedObject = properties; }
Sample:
|
|
However we have created another sample for displaying only the custom properties (which is defined in customized class) in PropertyEditor. Please create the custom class inherited from TypeConvertor class and use TypeDescriptor.CreateProperty() method to add custom property name to display properties you want. |
Sample:
|
Regards,
Naganathan K G
In previous update, we have provided the sample with 3.5 framework and 13.1350.0.21 version. Please ensure whether all the DLL's are referred properly in the provided project and also ensure that the DLLs are installed in your system’s GAC location. By default, the project’s DLLs are referred from GAC location. If DLLs are not installed in GAC location, then please refer to the DLLs manually in the sample.
However, we have attached sample with bin folder. Please refer to the below samples for your references.
Custom property with customized class sample:
Sample
Custom property with display property using PropertyGrid sample:
Sample
Regards,
Naganathan K G
- 3 Replies
- 2 Participants
-
BC Blanca Calderon
- Feb 9, 2016 11:43 AM UTC
- Feb 11, 2016 06:16 AM UTC