多谢指点,还有点小问题,要是能解决就完美了,因为我的TreeView和spread是左右排列的,虽然我我拖放时已经减去了Spread的Left和Top,可还是有点错位,拖放不到单元格中中间,就容易放到其它的单元格里,附代码,谢谢!
private void fpSpread1_DragDrop(object sender, DragEventArgs e)
{
FarPoint.Win.Spread .Model.CellRange cellRange = fpSpread1.GetCellFromPixel(0,0, e.X-fpSpread1.Left , e.Y - fpSpread1.Top);
fpSpread1.ActiveSheet .Cells[cellRange .Row ,cellRange .Column].Text = e.Data.GetData(DataFormats.Text).ToString().Trim();
} |