VIsual Studio 2005 (VB Winform) Datagrid FOR Iteration Very Slow
In a VS2005, VB Windows app we populate a datagridview from a SQLCE DB.
The grid has a check box ("IsSelected") which allows the user to select individual rows or they can select all if required.
Once the selection has been made, they use a combobox outwith the grid and a button to alter the value in one column (BINPrice). As there can be as many as 5000 rows in the grid, this is taking several minutes using the following FOR :
Dim id As Integer
For id = 0 To DataGridView1.Rows.Count - 1
If DataGridView1.Rows(id).Cells("IsSelected").Value = True Then
DataGridView1.Rows(id).Cells("BINPrice").Value = txtApplyBINPrice.Text
MsgBox("To be added later")
As we fill the grid from the DB in around four seconds, surely there must be a quicker way of doing this ? Is it possible to select the whole column and then apply the value from the combobox ?