回复 18楼cao104621的帖子
就您15楼提供的demo,按照您13楼说的问题,我验证了一下,目前问题出在这个函数上。
您可通过debug,调试一下:
- void fpSpread1_LeaveCell(object sender, FarPoint.Win.Spread.LeaveCellEventArgs e)
- {
- FarPoint.Win.Spread.SheetView oSheetView = fpSpread1.ActiveSheet;
- oSheetView.ActiveCell.BackColor = System.Drawing.Color.White;
- if (e.Column == 1)
- {
- if (e.NewColumn == 2)
- {
- e.NewColumn = 3;
- }
- }
- else if (e.Column == 3)
- {
- if (e.NewColumn == 2)
- {
- e.NewColumn = 1;
- }
- }
- if (e.Column == 5)
- {
- if (e.NewColumn == 6)
- {
- e.NewRow = e.Row + 1;
- }
- }
- if (e.Column != 2)
- {
- if (e.NewRow != oSheetView.RowCount)
- {
- oSheetView.Cells[e.NewRow, e.NewColumn].BackColor = System.Drawing.Color.Cyan;
- oSheetView.SetActiveCell(e.NewRow, e.NewColumn);
- }
- else
- {
- oSheetView.Cells[e.NewRow - 1, e.NewColumn].BackColor = System.Drawing.Color.Cyan;
- oSheetView.SetActiveCell(e.NewRow - 1, e.NewColumn);
- }
- }
- }
复制代码 |