We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Current Cell

Hello,

I am trying to implement a drag and drop operation from a tree view control to the spreadsheet control. How do I get the cell value of the cell that the item is being dropped onto?

Scott





1 Reply

PA Ponraja A Syncfusion Team January 6, 2012 12:43 PM UTC

Hi Scott,

Sorry for the delay caused.

You can get the dropped row and column index of the grid, by using the PointToCellRowColumnIndex method as shown in the following code.

Sample Code [C#]

void SpreadSheetControl_Drop(object sender, DragEventArgs e)
{
var point = e.GetPosition(spreadSheetControl);
GridControlBase grid = spreadSheetControl.GridProperties.CurrentCell.Grid;
RowColumnIndex rowColumnIndex = grid.PointToCellRowColumnIndex(point);
var cellvalue = grid.Model[rowColumnIndex.RowIndex, rowColumnIndex.ColumnIndex].CellValue;
}

Please let us know if you have any queries.

Regards,
Ponraja



Loader.
Live Chat Icon For mobile
Up arrow icon