Posted 8 September 2017, 12:54 pm ESTHello,
I did a method to change alignment of cell content.
To improve performance, I change VerticalAlignment and HorizontalAlignment properties of columns/rows and not these properties of cells when I want to change alignment of columns/rows entirely.
I´m using the following code:
For Each cr As FarPoint.Win.Spread.Model.CellRange In cellRange
If cr.Row = -1 Then
If cr.Column = -1 Then
Inicio = 0
Fim = sheetView.Columns.Count - 1
Inicio = cr.Column
Fim = cr.Column + cr.ColumnCount - 1
For Col As Integer = Inicio To Fim
sheetView.Columns(Col).VerticalAlignment = Vertical
sheetView.Columns(Col).HorizontalAlignment = Horizontal
ElseIf cr.Column = -1 Then
Inicio = cr.Row
Fim = cr.Row + cr.RowCount - 1
For Row As Integer = Inicio To Fim
sheetView.Rows(Row).VerticalAlignment = Vertical
sheetView.Rows(Row).HorizontalAlignment = Horizontal
For Row As Integer = cr.Row To cr.Row + cr.RowCount - 1
For Col As Integer = cr.Column To cr.Column + cr.ColumnCount - 1
With sheetView.Cells(Row, Col)
.VerticalAlignment = Vertical
.HorizontalAlignment = Horizontal
However, it doesn´t work. Anything happens.
Do you get to see where the error is?