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.
Syncfusion Feedback

Bug in Diagram Expander sample

Thread ID:

Created:

Updated:

Platform:

Replies:

123371 Mar 11,2016 09:50 AM UTC Mar 16,2016 01:31 PM UTC Windows Forms 4
loading
Tags: Diagram
Heinz Kessler
Asked On March 11, 2016 09:50 AM UTC

The Diagram Expander Sample code has a bug.

How to reproduce:
- Start the demo
- Set LayoutDirection to "RightToLeft"
- Collapse the topmost node, this is the upper one of the two children of the root node, you should now see 8 remaining nodes
- Try to collapse the lowest node (it has two children)

Result:
The node does not react on collapse/expand mouse clicks

Cause:
The Form1.diagram1_MouseMove() method uses the controller's GetNodeAtPoint method to find the node under the mouse cursor. Since some of the nodes are hidden, the method will return node 10 (one of the collapsed ones), not node 5, the one we intended.

Solution:
The code should look like this:
var nodesAtPoint = diagram1.Controller.GetNodesAtPoint( diagram1.Controller.ConvertToModelCoordinates( e.Location ) );
foreachvar n in nodesAtPoint )
{
    var no = n as ExpanderNode;
    if( no != null )
    {
        if( no.Visible )
        {
            no.MouseMove( diagram1.Controller.ConvertToModelCoordinates( e.Location ) );
            break;
        }
    }
}
This iterates over all nodes at the give point and picks the first one that is visible.

Hope this helps somebody :-)




Heinz Kessler
Replied On March 11, 2016 11:58 AM UTC

Correction:

The first line in my code below must be replaced by:
var clientCoordinates = diagram1.Controller.ConvertFromModelToClientCoordinates( diagram1.Controller.ConvertToModelCoordinates( e.Location ) );
var nodesAtPoint = diagram1.Controller.GetNodesAtPoint( clientCoordinates );



Naganathan Ganesh Babu [Syncfusion]
Replied On March 14, 2016 12:55 PM UTC

Hi Heinz,
 
Thanks for contacting Syncfusion support.
 
We are unable to reproduce the reported issue at our end. Please refer to the below attached video for your references.
 
Video:
 
Video
 
Also please provide the version where the reported issue appears and please provide more information, probably your sample or video which will help us to analyze further and provide you with a better solution.
 
Regards,
 
Naganathan K G

Heinz Kessler
Replied On March 15, 2016 07:16 AM UTC

Hello,
thanks for the reply. In your video, you did not reproduce the bug correctly.
I think, the video below will illustrate how to reproduce the bug.
The bug is reproducable with the latest version of SyncFusion Winforms.


Naganathan Ganesh Babu [Syncfusion]
Replied On March 16, 2016 01:31 PM UTC

Hi Heinz,
 
Thanks for your update.
 
We are able to reproduce the reported issue at our end. However we have fixed and modified the expander sample. Please refer to the below sample.
 
Sample:
 
Sample
 
Regards,
 
Naganathan K G

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.

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

;