All the looping is taking the time away, especially the double loops. A lot of these changes can be made with a single command by using the columns as the basic unit rather than the cell, eg.
DataGridView1.Columns(0).DefaultCellStyle.ForeColor = Color.Orange
Then if you want single cells to vary from the column default you can do that for the individual cells rather than looping through setting every one. I have to say I don't really understand the purpose of..
For i = 0 To (rowcnt / 2)
DtdgDataSource.Rows(i).DefaultCellStyle.BackColor = Color.LemonChiffon
Next
Why would you want to divide the DGV in half arbitrarily?




Reply With Quote
