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

Change background color on whole column?

If I go inot excel and highligh a whole column by clickingont he column header, then select "Cell Formatting" I can change the background color for the whole column.

Is there a way to do this with XlsIO? I have other formatting for the various cells within the columns already, i do not want to overwrite this, just change the background color for all cells within the column.

--Tim

1 Reply

PJ Pravin Joshua D Syncfusion Team December 9, 2009 07:06 AM UTC

Hi Timothy,

Thank you for using Syncfusion products.

Yes. It is possible to change the background color of entire column, without changing the other formatting of cells within the column, using XlsIO. You can use the following code snippet to change the background color.

C#:

sheet.Range["A1"].EntireColumn.CellStyle.ColorIndex=ExcelKnownColors.Aqua;

Please try this and let me know if you have any questions.

Regards,
Pravin Joshua D

Loader.
Live Chat Icon For mobile
Up arrow icon