回复 3楼zongxudong的帖子
可以通过以下代码获取当前单元格相对于 表单左上角 的位置:
- void gcSpreadSheet1_CellClick(object sender, GrapeCity.Windows.SpreadSheet.UI.CellClickEventArgs e)
- {
- int rowCount = e.Row-1;
- int colCount = e.Column-1;
- double cellleft=this.gcSpreadSheet1.Sheets[0].GetActualColumnWidth(0, colCount, GrapeCity.Windows.SpreadSheet.Data.SheetArea.Cells);
- double celltop = this.gcSpreadSheet1.Sheets[0].GetActualRowHeight(0, rowCount, GrapeCity.Windows.SpreadSheet.Data.SheetArea.Cells);
- double rowheaderleft=this.gcSpreadSheet1.Sheets[0].GetActualColumnWidth(0, this.gcSpreadSheet1.Sheets[0].RowHeader.ColumnCount, GrapeCity.Windows.SpreadSheet.Data.SheetArea.RowHeader);
- double colheadertop=this.gcSpreadSheet1.Sheets[0].GetActualColumnWidth(0, this.gcSpreadSheet1.Sheets[0].ColumnHeader.RowCount, GrapeCity.Windows.SpreadSheet.Data.SheetArea.ColumnHeader);
- }
复制代码 |