Posted 9 March 2023, 3:22 pm EST
Hello Christian,
Based on your request to align shapes with the edges of rows or columns, we would like to inform you that you can achieve this without knowing the exact coordinates of the rows and columns. Instead, you can use the startRow(), startColumn(), startRowOffset(), startColumnOffset(), endRow(), and endColumn() methods of the GC.Spread.Sheets.Shape class to position the shape at the desired location on the worksheet.
We have shared a sample code snippet with you to demonstrate how to use these methods effectively. You can refer to the attached sample for a better understanding of the implementation.
Here is an example code snippet that changes the shape’s location on the worksheet:
// changes shape's location on worksheet
shape.startRow(startRow);
shape.startColumn(startCol);
shape.startRowOffset(startRowOffset);
shape.startColumnOffset(startColOffset);
Sample: https://jscodemine.grapecity.com/share/AwbtpUdVY06Zqi_camDHGA/?defaultOpen={"OpenedFileName"%3A["%2Findex.html"]%2C"ActiveFile"%3A"%2Findex.html"}
If the solution provided does not meet your needs, please let us know your use case in detail, and we will be happy to provide you with an alternative solution. Additionally, if you encounter any issues, please do not hesitate to contact us.
For further information, please refer to the GC.Spread.Sheets.Shape class documentation, available at https://www.grapecity.com/spreadjs/api/v15/classes/GC.Spread.Sheets.Shapes.Shape#class-shape.
We hope this information is helpful.
Regards,
Ankit