We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Usage of MergeRanges

Does anyone has a sample or knows how to use MergeRanges method of the Worksheet.

We are looking if Syncfusion XlsIO support cell merge programatically.

Thanks .

1 Reply

LR Lokesh R Syncfusion Team April 28, 2010 02:21 PM UTC

Hi Erick,

Thank you very much for your interest on Syncfusion products.

MergeRanges method:

The MergeRanges() method is used to merge the range index not the actual cells,
For eg:
sheet.MergeRanges(wkSheet.Range["A1:A3"], wkSheet.Range["B1:B3"]);

It will return the IRange object with the address value as 'Sheet1'!A1:B3.

Cell merge:

Yes, in XlsIO it is possible to merge the cells by using Merge() method associated with the IRange .
For eg:
wkSheet.Range["C1:C3"].Merge();
the cells from C1 to C3 will be merged into a single cell.

I have created a sample which explains both the methods. Please, try the sample from the below link and let us know if this helps you.

Sample link:

http://help.syncfusion.com/samples/XlsIO.Windows/94176.zip


Please, let me know if you need any clarifications.

Thanks,
Lokesh


Loader.
Live Chat Icon For mobile
Up arrow icon