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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

autofitrow, merged cells in row

Thread ID:





54685 Jan 15,2007 02:15 PM UTC Apr 18,2008 04:48 AM UTC WinForms 3
Tags: XlsIO
Giancarlo Aguilera
Asked On January 15, 2007 02:15 PM UTC


My question is related to:

Basically I have a row with merged cells and have set wraptext = true. I would like to call autofitrow so that this row is sized according to the contents of the merged cells. I know neither excel nor xlsio support this, with good reason I suppose. My question is however, do you guys have a workaround anywhere? Am I going to have to get down and dirty with a graphics object to do this :(?



Melba Winshia [Syncfusion]
Replied On January 16, 2007 11:46 AM UTC

Hi GA,

It is not possible to AutoFit a row that contains a cell merged with cells in other rows. But as a workaround you can adjust row height and column width by using the following code snippets.


//Set Row height.(workaroud to autofitrows)

Here is the sample for your reference:


Please take a look at the sample above and let me know if you have any other questions.

Best Regards,

Amal Ibrahim
Replied On April 10, 2008 01:01 PM UTC

Is there a better work around in XLSIO 6.2? I need to merge the cells then autofit the rows this seems not to work at all.
Please advice.

Yavanaarasi G [Syncfusion]
Replied On April 18, 2008 04:48 AM UTC

Hi Amal,

Sorry for the delay in responding.

I am not able to reproduce the issue that you mentioned here. As per your requirements I have created one sample, merge the cells and autofit the rows. Here it works fine. I have tested this issue in Win Xp with service pack2,.Netframework 3.5, Office 2003.

Please refer the below code snippet:

sheet1.Range["B9:B14"].Text = "This is the Autofit Rows";

Here is the sample for your reference:

Please have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample and send us the modified sample so that we could sort out the cause of the issue and provide you a solution?

Also please provide your system details and the office version.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon