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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

autofitrow, merged cells in row

Thread ID:

Created:

Updated:

Platform:

Replies:

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

Hi!

My question is related to:
http://www.syncfusion.com/support/Forums/message.aspx?MessageID=26974

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 :(?

Thanks

GA


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.

[C#]
sheet.Range["C3:C4"].Merge();
sheet.Range["C3"].AutofitColumns();

//Set Row height.(workaroud to autofitrows)
sheet.Range["C3"].RowHeight=42;

Here is the sample for your reference:

Test_XLSIO.zip

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

Best Regards,
Melba

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

Hi,
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.
Thanks
Amal


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:

[C#]
sheet1.Range["A9:A11"].Merge();
sheet1.Range["B9:B14"].Text = "This is the Autofit Rows";
sheet1.Range["B9:B14"].AutofitRows();


Here is the sample for your reference:
http://websamples.syncfusion.com/samples/XlsIO.Windows/42897/main.htm

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.

Regards,
G.Yavana


CONFIRMATION

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.

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

;