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

node selection(focus) problem

Hi,

I have the following code part;


void EventSink_NodeClick(NodeMouseEventArgs evtArgs)
{
evtArgs.Node.EditStyle.AllowChangeHeight = false;

}

When user clicks to a node,he/she will not be able to change Height of it.
But if the same node clicked again, diagram allows to change the height of it. So I can not control the "EditStyle" properties as I want. (if a node is clicked 3-4 times focus jumps to the other nodes.)

the number of clicks on a node should not change anything.How can I manage this?

Thanks for your help


6 Replies

AM Ajeet M Syncfusion Team January 28, 2009 01:35 PM UTC

Hi ace,

I assume that you are using the latest version of syncfusion assemblies.

I am afraid but I am not able to reproduce the issue.

I set the same code snippet to disable height modification.

The Node does not allow height to be changed then after.

The sample file is attached herewith for your perusal.

Also, by default the diagram convention of "NodeClick" event is to cycle through the ZOrders of every node present at a same point of mouse click, starting from the top most node to the node lowest at the "clicked mouse point".

Let me know if this helps.

Happy coding!
- Ajeet




Diagram_WF_NodeEvents_86a47cd6.zip


AD Administrator Syncfusion Team January 28, 2009 03:22 PM UTC

Hi Ajeet,

I solve the problem by disabling the size changing allmost everytime any event occurs.

In your program when you drag and drop circle or ellipse you can change their height and width just after dropping them. if you consider the rectangle some different things happen.

your program doesn't produce same problem with me but It seems it doesnt act as it should.

As I told, I solved my problem and thank you for your afford for help.




AM Ajeet M Syncfusion Team January 29, 2009 08:14 AM UTC

Hi ace,

Yes, you are right that the SizeChanging Event can be cancelled, but that will disable both change in height and change in width by default.

Also, I am afraid as I was not able to change the height of the Circle or Ellipse as soon as I dropped it to the diagram and NodeClicked() on it.

Let me know if you shall need any further clarifications here.

Happy Coding!,
- Ajeet



AD Administrator Syncfusion Team January 30, 2009 12:34 PM UTC

Hi Ajeet,

You said;
"Also, by default the diagram convention of "NodeClick" event is to cycle through the ZOrders of every node present at a same point of mouse click, starting from the top most node to the node lowest at the "clicked mouse point"."

This is the cause of my problem. I don't want it to cycle through the ZOrders of every node present at a same point. Can I stop cycling?







AM Ajeet M Syncfusion Team February 2, 2009 08:57 AM UTC

Hi ace,

The cycling through all the nodes under the same point is an inherent property, which can not be overrided.

However, you can be assured that the "Node" which is at the top, among all the nodes that are placed under the same point location; the MouseClick() and NodeClick() and NodesHit will all return the "Top Most Node".

Also, its only the focus that changes in cyclic order, which can be overridden as follows:

In the MouseUp() event type the following code snippet:

void diagram1_MouseUp(object sender, MouseEventArgs e)
{
if (!this.diagram1.Controller.SelectionList.IsEmpty)
{
this.diagram1.Controller.SelectionList.Clear();
this.diagram1.Controller.SelectionList.Add(this.diagram1.Controller.NodesHit.First);
}
}

This ensures that the selected"Node" is the always focused.

Let me know if you shall need any further clarifications in this regard.


Happy Coding!
- Ajeet



AD Administrator Syncfusion Team February 5, 2009 11:57 AM UTC

That helped a lot
Thanks for your concern Ajeet.


Loader.
Live Chat Icon For mobile
Up arrow icon