Jun
29
Written by:
Steve Gray
6/29/2009 11:36 AM
This code sample will demonstrate how to iterate through a Janus grid in VB.NET
Dim row As Janus.Windows.GridEX.GridEXRow
Dim bSelected As Boolean
'loop through the grid and make sure that there are no errors
For i = 0 To Me.grdBidders.RowCount - 1
Me.grdBidders.Row = i
row = Me.grdBidders.GetRow()
bSelected = row.Cells("selected").Value
If bSelected Then
'code here
End If
Next
This is a little simpler:
For Each row In Me.grdProtected.GetRows
bSelected = row.Cells("selected").Value
If bSelected Then
'code here
End If
Next
This is the easiest, if you’re trying to get only the rows that are checked. Add a checkbox column to the grid and set it’s ‘actAsSelector’ property to True. Then use this code
For Each row In Me.grdProtected.GetCheckedRows
strItemNumber = row.Cells("itemnmbr").Value
Next
As always, I welcome your comments!