Version 4.2.0.0

I get the following compilation error when trying to rebuild some code with 4.2.0.0:

Property or indexer 'Aspose.Cells.Row.Style' cannot be assigned to -- it is read only

Previously the code built fine with 4.1.1.0

Apparently Aspose no longer allows you to set a style for an entire row? Is this a feature that we should plan on getting used to, or an oversight? I can probably rework my code but first I wanted to ask.

Hi,

Thanks for considering Aspose.

Well, yes, it is a read-only property. I think you better use Style object and specify format settings and apply it to your required row. It will also enhance your performance too.

Following is the example code which describes how to apply some formattings to an entire row (7th row) using the newer version, and same would be applied to format any column:

Workbook workbook = new Workbook();

Worksheet worksheet = workbook.Worksheets[0];

Cells cells = worksheet.Cells;

Style stl;

StyleFlag flag = new StyleFlag();

flag.CellShading = true;

stl = cells.Rows[6].Style;

stl.Pattern = BackgroundType.Solid;

stl.ForegroundColor = Color.Silver;

cells.Rows[6].ApplyStyle(stl,flag);

workbook.Save("d:\\test\\testingrowstyles.xls");

Thank you.

Thanks Amjad. I'll rework my code for this new method.

BTW I tested setting the style property of a column using "Aspose.Cells.Column.Style = " and the compiler did not throw an error.

May be an inconsistency.

Thank you for the information. We will change it soon.