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.
Unfortunately, activation email could not send to your email. Please try again.

Button inside a node and context menu

Thread ID:

Created:

Updated:

Platform:

Replies:

117550 Nov 6,2014 03:41 AM Nov 10,2014 02:09 AM WinRT 4
loading
Tags: SfDiagram
Vladimir
Asked On November 6, 2014 03:41 AM

Hi everyone,

I have two questions. I have an app where every Node contains two buttons(add new child, delete itself) if I press one of these buttons the Node gets automaticaly selected by default. Is there a way to prevent the auto selection if I press the button inside the node?

the second question is: how I can override the default context menu which shows up if I select a node? for instance, I want that, if I select a node only the border of a selected node changes his color and no context menu shows up

thanks in advance,
Vladimir.

Vladimir
Replied On November 7, 2014 03:43 AM

The first issue with the buttons is resolved now.
 public class NoBubleButton : Button
    {
        protected override void OnTapped(TappedRoutedEventArgs e)
        {
            base.OnTapped(e);
            e.Handled = true;            
        }
    }

But I am still looking forward for your piece of advice for the second problem I have.

Saranya Chandrasekaran [Syncfusion]
Replied On November 7, 2014 04:10 AM

Hi Vladimir,

Please find the response of your queries as below.

S.No

Query

Response

1.

Is there a way to prevent the auto selection if I press the button inside the node?

 

We have support to enable/ disable the Node Selection behavior. Your requirement can be achieved by using NodeConstraints. Please refer to the following code snippet to disable Node selection.

 

Code Snippet:

 

node.Constraints=node1.Constraints &~ NodeConstraints.Selectable;

//Here, node is the instance of the node

 

For more details about Node constraints, please refer to the following online help documentation link.

Link:

http://help.syncfusion.com/UG/winrt/documents/nodes.htm :  Node Constraints

2.

how I can override the default context menu which shows up if I select a node? for instance, I want that, if I select a node only the border of a selected node changes his color and no context menu shows up

 

We don’t have any default context menu for Node.

Your requirement “to change the border of the selected Node” can be achieved by using ShapeStyle property of the Node.

 

 

For more details about Node shape and shape style, please refer to the following online help documentation link.

 

Link:

http://help.syncfusion.com/UG/winrt/documents/nodes.htm :

Setting the Node Shape and Shape Style

 

This would be better for us if you provide more information about your context menu  requirement. So that we will investigate further on this and update you with the proper solution.

 

 

Please let us know if you have any concerns

Regards,

Saranya C

 


Vladimir
Replied On November 7, 2014 04:27 AM

Thanks for the response. The solution you provided is not suitable in my case. I still want to keep nodes selectable the only thing I wanted to override is a selection if I press on a button inside a node. Nevermind, I already found a solution...
about the context menu. If I select a node a "toolbox" shows up... The question was, How I can prevent it from showing ?



thanks!

Saranya Chandrasekaran [Syncfusion]
Replied On November 10, 2014 02:09 AM

Hi Vladimir,

Please find the response of your query as below.

S.No

Query

Response

1.

If I select a node a "toolbox" shows up... The question was, How I can prevent it from showing ?

 

 

We have analyzed your requirement from your query. Your requirement is disable the Quick Commands (Delete, Duplicate and Connection) in the Node. We have provided code snippet to achieve your requirement. Please refer to the code snippet as below.

Code Snippet:

//Disable Quick Commands

(diagram.SelectedItems as SelectorViewModel).QuickCommands = Visibility.Collapsed;

//Here, diagram is the name of the SfDiagram.

 

Please let us know if you have any concerns

Regards,
Saranya C


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.

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.

;