How to draw straight lines from a cell center to another

Posted by: zhenghq on 8 September 2017, 2:48 pm EST

  • Posted 8 September 2017, 2:48 pm EST

    Because the Spread doesn't support OwnerDrawCell like C1flexgrid

    I want to konw how to draw straight lines from a cell center to another where has a "?" in it by using "if else"

    the Attachement includes a project and a screenshot from my Excel

    please help me to achieve the project the same as the screeenshot

    Much appreciate

    Kerry


    2011/11/DrawStraightLines.zip
  • Replied 8 September 2017, 2:48 pm EST

    Check out the V6FeatureDemo Form_Load code
    where we add LineShapes to draw lines between the sparkline markers and the
    RectangleShape labels for them.



    If you are trying to implement formula dependent/precedent lines, those are
    already implemented.  ShowDependents/ShowPrecedents will show the lines
    for the specified cell, and HideDependents/HidePrecedents will hide them. 
    Their screen show will help you to tell what they are trying to do.



  • Replied 8 September 2017, 2:48 pm EST

    where can i get the "V6FeatureDemo Form_Load"  you mentioned

    thanks

    kerry

  • Replied 8 September 2017, 2:48 pm EST

    Hello kerry,

    You can find this in the sample which is automatically saved in the following location if you have installed Spread6.

     C:\Program Files\GrapeCity\Spread .NET 6\Windows Forms\v6.0.3501\Samples\Cs\V6FeatureDemo

    Thanks,

    Subodh

     

  • Replied 8 September 2017, 2:48 pm EST

    Hello Kerry,

    I would suggest you to use the Paint event of Spread to draw the lines between the cells. I am attaching a sample depicting the same, kindly have a look at it.

    Hope it will help you. Please let me know if you have any queries further.

    Thanks,

    Manpreet Kaur.


    2011/11/drawaline.zip
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels