GridDesktop での Cells のマージとマージ解除

合併 Cells

セルを 1 つの大きなセルに結合するには、次の手順に従ってください。

  • 任意のアクセスワークシート
  • 作成するCellsの範囲合併する
  • マージセルの範囲を大きなセルに

使用できますマージ方法ワークシートセルを結合します。ただし、セルの範囲は次を使用して定義できます。セル範囲物体。

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Accessing the worksheet of the Grid that is currently active
Worksheet sheet = gridDesktop1.GetActiveWorksheet();
// Creating a CellRange object starting from "B4" to "C6"
CellRange range = new CellRange("B4", "C6");
// Merging a range of cells
sheet.Merge(range);

アンマージ Cells

大きなセルを多くのセルに結合解除するには、次の手順に従ってください。

  • 任意のアクセスワークシート
  • 結合を解除する必要がある結合セルにアクセスする
  • マージ解除結合されたセルの位置を使用して、大きなセルを多くのセルに

使用できますマージ解除方法ワークシートその場所を使用してセルの結合を解除します。

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET
// Accessing the worksheet of the Grid that is currently active
Worksheet sheet = gridDesktop1.GetActiveWorksheet();
// Accessing the merged cell that is currently in focus
GridCell cell = sheet.GetFocusedCell();
// Unmerging a cell using its location
sheet.Unmerge(cell.Location);