vb-dev
2022-05-24T17:19:33Z
I'm currently doing this:

    <Extension>
    Public Sub UncheckAllRows(ByVal Grid As TenTec.Windows.iGridLib.iGrid, ByVal ColumnKey As String)
        Dim column = Grid.Cols(ColumnKey)

        If column.CellStyle.Type.Equals(iGCellType.Check) Then
            For Each cell As iGCell In column.Cells
                cell.Value = CheckState.Unchecked
            Next
        End If
    End Sub

This is fine for a small number of rows, but takes far too long when the row count is, in my test case, 40,000 rows. Can someone recommend something cleaner and faster?

Thank you.
vb-dev
2022-05-25T11:57:02Z
Edit:

I have found the following to be much more performant and I think we're going to be fine with it. If anyone can improve upon this, however, please feel free to share.

    <Extension>
    Public Sub UncheckAllRows(ByVal Grid As TenTec.Windows.iGridLib.iGrid, ByVal ColumnKey As String)
        For Each cell As iGCell In Grid.Cols(ColumnKey).Cells
            If Not cell.Value Is Nothing AndAlso cell.Value.Equals(True) Then
                cell.Value = False
            End If
        Next
    End Sub
Igor/10Tec
2022-05-25T15:03:57Z
If you do bulk changes in iGrid cells, wrap your code snippet with the iGrid.BeginUpdate() and iGrid.EndUpdate() method calls. The BeginUpdate() method disables screen update after every cell change, which may enhance the performance of your code dramatically.
vb-dev
2022-05-25T15:07:52Z
Thanks for the reminder, Igor. I intended to do that as well but forgot.