Width

Problem setting the width of a column in a range after moving it. Here is an example:


	var notes = sheet.Cells.CreateRange(0, (int) Columns.Notes, sheet.Cells.MaxDataRow, 1);
notes.Name = “Notes”;
AddFCI(sheet, TwoDecimalNumericStyle, NumberStyleFlag);</pre><pre style="font-family: Consolas; font-size: 13px; background-color: white; background-position: initial initial; background-repeat: initial initial;">	notes.MoveTo(0, sheet.Cells.MaxDataColumn + 1);

	var column = sheet.Cells.Columns[notes.FirstColumn];
column.Width = 50;
column.ApplyStyle(WrapStyle, WrapStyleFlag);
var s = column.Style;
s.IndentLevel = 2;
column.ApplyStyle(s, WrapStyleFlag);

If comment out the MoveTo call, I get the desired result. If I leave it in, all the options are correct on column except for the width.

The AddFCI call is adding columns, so I am moving the notes range (which is just one column) to the end.

Hi,


I tested your scenario a bit in MS Excel manually. When you create a range based on some column cells and then move that range to some other location in the sheet, the column’s width from the source column(s) are not taken into account or not retained. Aspose.Cells works fine same as MS Excel, so you could also manually perform your steps (moving the range to some other location for confirmation. If you still find the issue and come to know that Aspose.Cells works differently than MS Excel, kindly create a sample console application (runnable), zip it and post it here to show the issue, we will check your issue soon. Also, provide the template files if you have any.

Moreover, we recommend you to try our latest version/fix: Aspose.Cells for .NET v7.7.2.1


Thank you.