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
close icon

complex symbols

Hi
Having a complex symbol i want to be able to understand on which node the user has clicked.
for example, i want to know the index number of the node contained in the symbol that the user has clicked in order to paint it. in the sample below i can paint the node only if i provide a specific index number.

Private Sub Diagram1_NodeDoubleClick(ByVal sender As Object, ByVal evtArgs As Syncfusion.Windows.Forms.Diagram.NodeMouseEventArgs) Handles Diagram1.NodeDoubleClick
If TypeOf evtArgs.Node Is Syncfusion.Windows.Forms.Diagram.Symbol Then
Dim s As Syncfusion.Windows.Forms.Diagram.Symbol = evtArgs.Node
Dim sb As Syncfusion.Windows.Forms.Diagram.Polygon
sb = s.Nodes(2)
sb.FillStyle.Color = Color.Red
End If
End Sub

Thanks
Stelios Halkiotis



5 Replies

J. J.Nagarajan Syncfusion Team September 5, 2006 07:13 PM UTC

Hi Stelios,

Thankyou for your interest in Essential Diagram.

Please use the GetChildIndex() method of the Symbol Class in the Diagram_NodeClick event inorder to get the index of the node contained in the symbol.



[VB]
Private Sub diagram1_NodeClick(ByVal sender As Object, ByVal evtArgs As Syncfusion.Windows.Forms.Diagram.NodeMouseEventArgs) Handles diagram1.NodeClick
Dim y As Integer=Me.diagram1.Model.GetChildIndex(evtArgs.Node)



Please refer the sample attached which demonstrates this usage. In this sample, a Nested Symbol will be loaded in the Form_Load event. When you click on the Symbols you can see the Index number of the clicked symbol in the textbox and its color will be changed appropriately.

Please try this and let us know if this helps.

Thanks,
Nagaraj

NestedSymbol.zip



AD Administrator Syncfusion Team September 6, 2006 06:43 AM UTC

Hi Nagaraj

Thanks for your reply.
I cannot test the sample because there are build errors. the errors that i see are:
(184): ''MinimumSize'' is not a member of ''Syncfusion.Windows.Forms.Diagram.Model''.
(30): Interface ''System.Runtime.Serialization.ISerializable'' is already implemented by base class ''Syncfusion.Windows.Forms.Diagram.SymbolBase''.
(43): ''System.Runtime.Serialization.ISerializable.GetObjectData'' is already implemented by base class ''Syncfusion.Windows.Forms.Diagram.SymbolBase'' and cannot be implemented again.
(31): Interface ''System.Runtime.Serialization.ISerializable'' is already implemented by base class ''Syncfusion.Windows.Forms.Diagram.SymbolBase''.
(44): ''System.Runtime.Serialization.ISerializable.GetObjectData'' is already implemented by base class ''Syncfusion.Windows.Forms.Diagram.SymbolBase'' and cannot be implemented again.

Using the code suggested in your post, i always get as index value equal to zero.

Thanks for your support
Stelios Halkiotis
>Hi Stelios,

Thankyou for your interest in Essential Diagram.

Please use the GetChildIndex() method of the Symbol Class in the Diagram_NodeClick event inorder to get the index of the node contained in the symbol.



[VB]
Private Sub diagram1_NodeClick(ByVal sender As Object, ByVal evtArgs As Syncfusion.Windows.Forms.Diagram.NodeMouseEventArgs) Handles diagram1.NodeClick
Dim y As Integer=Me.diagram1.Model.GetChildIndex(evtArgs.Node)



Please refer the sample attached which demonstrates this usage. In this sample, a Nested Symbol will be loaded in the Form_Load event. When you click on the Symbols you can see the Index number of the clicked symbol in the textbox and its color will be changed appropriately.

Please try this and let us know if this helps.

Thanks,
Nagaraj

NestedSymbol.zip



J. J.Nagarajan Syncfusion Team September 7, 2006 08:17 PM UTC

Hi Stelios,

We regret for the inconvenience caused.In the present scenario of Diagram control we have no special click events for the Child nodes of the complex symbol.The Node_Click event gets fired When you click on the complex symbol.So that it always returns the index value of the complex symbol and not for the child nodes.However we will consult with our development team regarding this issue and will get back to you with more details very soon.

Thanks for your patience.

Thanks,
Nagaraj


GM Guy Mahieu February 7, 2007 11:34 AM UTC

Any news on this?

>Hi Stelios,

We regret for the inconvenience caused.In the present scenario of Diagram control we have no special click events for the Child nodes of the complex symbol.The Node_Click event gets fired When you click on the complex symbol.So that it always returns the index value of the complex symbol and not for the child nodes.However we will consult with our development team regarding this issue and will get back to you with more details very soon.

Thanks for your patience.

Thanks,
Nagaraj


J. J.Nagarajan Syncfusion Team February 8, 2007 12:53 AM UTC

Hi Guy,

Sorry for the inconvenience caused. The current diagram code was fully refactored and this refactored code version of Essential Diagram will surely have much better performance, usability and supportability. We have this functionality on our refactored code version. Due to some internal testing issues, we are not able to ship this new version in 4.4. However we will surely make this version available before the end of March.

Thanks for your patience.

Regards,
Nagaraj

Loader.
Live Chat Icon For mobile
Up arrow icon