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 "<span style="font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ascii-theme-font:minor-fareast;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:minor-fareast;mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;">?" in it by using "if else" </span>

    <span style="font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ascii-theme-font:minor-fareast;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:minor-fareast;mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;">the Attachement includes a project and a screenshot from my Excel</span>

    <span style="font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ascii-theme-font:minor-fareast;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:minor-fareast;mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;">please help me to achieve the project the same as the screeenshot</span>

    <span style="font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ascii-theme-font:minor-fareast;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:minor-fareast;mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;">Much appreciate</span>

    <span style="font-size:10.5pt;mso-bidi-font-size:11.0pt;mso-ascii-theme-font:minor-fareast;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:minor-fareast;mso-bidi-theme-font:minor-bidi;mso-ansi-language:EN-US;mso-fareast-language:ZH-CN;mso-bidi-language:AR-SA;">Kerry</span>


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

    <span style="font-size:12pt;mso-fareast-theme-font:minor-latin;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;mso-fareast-font-family:Calibri;">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.



    </span>
  • Replied 8 September 2017, 2:48 pm EST

    <font size="3">where can i get the "V6FeatureDemo Form_Load"  you mentioned</font>

    <font size="3">thanks </font>

    <font size="3">kerry</font>

  • 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