回复 1楼dbtxwds的帖子
请通过以下代码获取、删除选择行:
- private void removeSelectedRowsToolStripMenuItem_Click(object sender, EventArgs e)
- {
- SheetView sv = this.fpSpread1.Sheets[0];
- int rowcount = sv.RowCount;
- int colcount = sv.ColumnCount;
- FarPoint.Win.Spread.Model.DefaultSheetSelectionModel selectModel = sv.Models.Selection as FarPoint.Win.Spread.Model.DefaultSheetSelectionModel;
- CellRange[] crs = selectModel.GetSelections(rowcount, colcount);
- foreach (CellRange item in crs)
- {
- sv.RemoveRows(item.Row, 1);
- }
- }
复制代码 |