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.

Styling an entire header row

Thread ID:

Created:

Updated:

Platform:

Replies:

92749 Feb 2,2010 08:25 PM Feb 3,2010 01:54 AM Windows Forms 2
loading
Tags: XlsIO
DanHerbert
Asked On February 2, 2010 08:25 PM

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;

DanHerbert
Replied On February 2, 2010 08:40 PM

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 01:54 AM

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.

Regards,
Manimala.

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.

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.

;