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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Styling an entire header row

Thread ID:





92749 Feb 3,2010 01:25 AM UTC Feb 3,2010 06:54 AM UTC WinForms 2
Tags: XlsIO
Asked On February 3, 2010 01:25 AM UTC

I'm trying to generate a report that needs a header style (solid background, thin border on the bottom) that spans the entire length of a row in a worksheet.

The best I can seem to do is style a fixed range of cells in a row. Is there any way to apply a style to an entire row without having an existing template document?

I've tried code like the following, which only styles cells that have content in them:

var style = sheet.Rows[0].CellStyle;
style.FillPattern = ExcelPattern.Solid;
style.Font.Bold = true;
style.ColorIndex = ExcelKnownColors.Grey_40_percent;
var border = style.Borders[ExcelBordersIndex.EdgeBottom];
border.Color = ExcelKnownColors.Black;
border.LineStyle = ExcelLineStyle.Thin;

Replied On February 3, 2010 01:40 AM UTC

Nevermind, I figured out the solution. I needed to call:

sheet.SetDefaultRowStyle(1, style);

To apply a style to an entire row.

Manimala P [Syncfusion]
Replied On February 3, 2010 06:54 AM UTC

Hi Danherbert,

Thanks for your interest in Syncfusion products.

We are glad to hear that the problem has been solved.Thanks for the update.Please let me know if you have any other queries.



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

Live Chat Icon For mobile
Live Chat Icon