Free Support Forum - aspose.com

How to: convert Point to CellLocation

I wrote custom drag-n-drop for the GridDesktop.

I drag some template from the templates tree and drop it into cell.
When I drop the template, I need take CellLocation from mouse point, but I don’t know how to do.

Hi,

<?xml:namespace prefix = u1 /><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

We have provided a method named “GetCellLocationByClientPoint” to get the CellLocation in Aspose.Cells.GridDesktop v<?xml:namespace prefix = st1 />2.1.1.2003. Please try the following code:

private void gridDesktop1_DragEnter(object sender, DragEventArgs e)

{

// convert the screen coordinates point to client coordinates point first.

Point clientPoint = gridDesktop1.PointToClient(new Point(e.X, e.Y));

CellLocation cl = gridDesktop1.GetActiveWorksheet().GetCellLocationByClientPoint(clientPoint);

this.Text = clientPoint.X + "," + clientPoint.Y + ":" + cl.ToString();

}

Thank You & Best Regards,

It works perfectly
Thank You