Org Chart - Drag over a Team Member / GetShapeUnderDragPosition()

3 posts, 0 answers
  1. Jean-Christophe
    Jean-Christophe avatar
    2 posts
    Member since:
    Aug 2014

    Posted 25 Aug 2014 Link to this post

    Hello,

        I'm currently modifying the OrgChart example to add the ability to build a hierarchy inside a team (a team member can have children team member).
        To be able to know if the user is dragging a Team Member over another one I've modified the OgChartDiagram.GetShapeUnderPosition() to be able to get a list of shapes instead of the top shape :

    public List<RadDiagramShape> GetShapeUnderDragPosition()
    {
        List<IShape> ShapeList = this.ServiceLocator.GetService<IHitTestService>().GetTopShapesUnderPoint(this.currentDragPosition).ToList();
     
        List<RadDiagramShape> RetList = new List<RadDiagramShape>();
     
        foreach (IShape shape in ShapeList)
        {
            if (shape is RadDiagramShape)
            {
                RetList.Add((RadDiagramShape)shape);
            }
        }
     
        return RetList;
    }

    My problem is that the method always return a single team item, never a team member.
    (I also changed the inheritance of OrgTeamMemberViewModel to make it inherit from HierarchicalNodeViewModel instead of ViewModelBase..

    is GetTopShapesUnderPoint() the right method to use for this ?

    Thanks !
  2. Jean-Christophe
    Jean-Christophe avatar
    2 posts
    Member since:
    Aug 2014

    Posted 25 Aug 2014 in reply to Jean-Christophe Link to this post

    mmm... maybe I'm not sufficiently clear.

    Simply put, I want to know if there is a simple way to check (inside the Org Chart sample) if the user is draging over a Team OR a Team Member.

    I know that the default Org Chart sample easily checks for Teams, but can't find a way to check if the mouse point is over a Team Member....
  3. UI for WPF is Visual Studio 2017 Ready
  4. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 27 Aug 2014 Link to this post

    Hello,

    I suppose that you are talking about the GetShapeUnderDragPosition() method. If so, you are on the right way for customizing the example. Please note that in the method we are using the HitTestService to get the shape(s) under the mouse. 

    Are you saying that the method does not return the shape that is hovered when dragging?

    Regards,
    Pavel R. Pavlov
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top