I've isolated a piece of code that is taking a large performance hit. It is simply the formatting in a datagrid.
With a datagrid having 511 rows, this section alone takes up about 40 seconds.
I would appreciate any suggestions that might increase performance.
Padding padding = this.datagrid.Rows[row].Cells[column].Style.Padding;
padding.Left = composite.indentation * margin;
this.datagrid.Rows[row].Cells[column].Style.Padding = padding;
this.datagrid.Rows[row].Cells[column].Style.Alignment = DataGridViewContentAlignment.MiddleLeft;
this.datagrid.Rows[row].Cells[column].Style.WrapMode = DataGridViewTriState.False;