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.
Unfortunately, activation email could not send to your email. Please try again.

ColumnWidthToPixels - what is this for?

Thread ID:





51563 Nov 8,2006 10:28 AM Nov 9,2006 08:31 AM Windows Forms 1
Tags: XlsIO
Robert Chapman
Asked On November 8, 2006 10:28 AM

What does WorkSheet.ColumnWidthToPixels do?

Does it set all columns widths on the sheet to ACCEPT pixels as a width? SO that I can do
range.Cell.ColumnWidth = pixelValue

Melba Winshia [Syncfusion]
Replied On November 9, 2006 08:31 AM

Hi rob,

1) ColumnWidthToPixels property is used to convert the ColumnWidth to Pixels. It will return the columwidth in the pixel format. You can use this property to get the column width in pixels.

Here is the sample for your reference to get the columnwidth in pixels.


2) But you can not set range.Cell.ColumnWidth = pixelValue. Because range["A1"].ColumnWidth will not set the width in pixels. You can use this property just to get the column width in pixels.

Please take a look and let me know if you have any other questions.



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.

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.