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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Node selection

Thread ID:

Created:

Updated:

Platform:

Replies:

102820 Mar 6,2012 07:07 AM UTC Mar 9,2012 12:46 PM UTC WinForms 3
loading
Tags: Diagram
Christian Rattat
Asked On March 6, 2012 07:07 AM UTC

Hi,

I have a couple custom nodes which draw their content themselves. Now I need to detect within the node's drawing functions whether it is selected or not. If a node gets selected it should draw its content differently and do some other things.

How can I achieve this? I couldn't find anything in the node's properties to see if it is selected/activated.

Regards,
Christian




Amsath Ali M [Syncfusion]
Replied On March 8, 2012 09:14 AM UTC

Hi Christian,

Thanks for your interest in Syncfusion products.

We suggest you to use the Diagram’s ‘NodeSelected/Deselected’ event and Diagram.View’s ‘SelectionList’ property to find whether the given node is selected or not. Please refer the below code snippet to achieve your requirement.

Here is the code:
[C#]
diagram1.EventSink.NodeSelected += new Syncfusion.Windows.Forms.Diagram.NodeSelectedEventHandler(EventSink_NodeSelected);
diagram1.EventSink.NodeDeselected += new NodeSelectedEventHandler(EventSink_NodeDeselected);

void EventSink_NodeSelected(Syncfusion.Windows.Forms.Diagram.NodeSelectedEventArgs evtArgs)
{
if (diagram1.View.SelectionList[0] is CustomNode)
{
listBox1.Items.Clear();
listBox1.Items.Add("custom Node selected");
}
}

Here is the sample:
F102820-225975699.zip

Please try the above sample and let us know if you have any queries.

Regards,
Amsath Ali. M



Christian Rattat
Replied On March 8, 2012 03:47 PM UTC

Hi,

thanks for the explanation. I saw this event before but this means to maintain the node's states and render its content based on the selection, I have to manually set a flag in each node every time it gets selected or deselected. This is quite uncomfortable and also error prone.

As you are using the MVC pattern thus this should belong in the model and be available by the view part so that the view could indicate state changes and retrieve its current state from the model as MVC defines it.

Do you plan to change this in the future (we are on version 8.2 now) or did already in a later version?

Regards,
Christian


Amsath Ali M [Syncfusion]
Replied On March 9, 2012 12:46 PM UTC

Hi Christian,

Thanks for the update.

Currently we don’t provide support for “Need a property in node to indicate whether that node is selected or not”. This has been suspected to be a feature request. Please create a DT incident for your query so that we can update the patch for this feature.

You can create the DT incident from the following link.
http://www.syncfusion.com/account/dashboard

In the interests of maintaining confidentiality, we have a policy of not sharing patches or otherwise proprietary customer specific information in the public Forum.

Please let us know if you have any queries.

Regards,
Amsath Ali. M





CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

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

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

;