I’m using Infragistics Ultragrid 2008, I have a button used to check and uncheck the selected column in the grid.
Even if the row filter is activated also when I click the button it checks the hidden rows selected columns too.
I want to set selected column to true only for the rows that are visible. Please help me with the code for vb.net 2008
this is the code I’m using now
Me.lbltotal.Text = "0.00"
Dim i As Integer = 0
Dim nDx As Boolean = False
If Me.btnSelectAll.Text = "Select All" Then
nDx = True
Else
nDx = False
End If
While i < Me.UninvoicedMemosDataGrid.Rows.Count
Me.UninvoicedMemosDataGrid.Rows(i).Cells(9).Value = nDx
Me.UninvoicedMemosDataGrid.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.ExitEditMode)
Me.UninvoicedMemosDataGrid.Update()
i += 1
End While
If Me.btnSelectAll.Text = "Select All" Then
Me.btnSelectAll.Text = "Deselect All"
Else
Me.btnSelectAll.Text = "Select All"
End If
Dim r As Integer
Dim sum As Single = 0.0
For r = 0 To UninvoicedMemosDataGrid.Rows.Count - 1
If UninvoicedMemosDataGrid.Rows(r).Cells(9).Value() = True Then sum += UninvoicedMemosDataGrid.Rows(r).Cells(8).Value()
Me.lbltotal.Text = sum
Next
Dim n As Integer
n = Me.lbltotal.Text
lbltotal.Text = n.ToString("###,##0.00")
If your intention is to apply your calcs only for the rows not hidden by the current column filter then you should change your loops in this way
and this one
(Based on your code above, this should be always true or false for every row)
However I am not very sure of your intention here. So let me know if this is what you are looking for or if I have misanderstood your intentions.