Syncfusion.XlsIO.Base
Example 


Clears the Merged cell.

Merge(Boolean) Method

Combines the contents of the selected cells in a new larger cell with clear option flag.
Syntax
'Declaration
 
Overloads Sub Merge( _
   ByVal clearCells As Boolean _
) 
'Usage
 
Dim instance As IRange
Dim clearCells As Boolean
 
instance.Merge(clearCells)
void Merge( 
   bool clearCells
)

Parameters

clearCells
Clears the Merged cell.
Example
The following code illustrates how to merge the Range with clear option.
using Syncfusion.XlsIO;
            
class Program
{
    static void Main()
    {
        using (ExcelEngine excelEngine = new ExcelEngine())
        {
            //Create worksheet
            IApplication application = excelEngine.Excel;
            application.DefaultVersion = ExcelVersion.Excel2013;
            IWorkbook workbook = application.Workbooks.Create(1);                               
            IWorksheet worksheet = workbook.Worksheets[0];
            
            //Set text
            worksheet["A1"].Text = "Merged cell";
            worksheet["B1"].Text = "sample";
            
            //Merge cells
            worksheet["A1:B1"].Merge(true);
            
            //Unmerge cells
            worksheet["A1:B1"].UnMerge();
            
            //Save and dispose
            workbook.SaveAs("CellFormats.xlsx");
            workbook.Close(); 
        }
    }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 17.2460.0.34

See Also