Forum Discussion
nnguyen_1
12 years agoContributor
Here is the way I'm manipulating it, let me know if it's helpful for you.
Sub ClickCheckboxGridColumn(objGrid, i, strValue)
Dim strCurCellValue
SetFocusGridCell objGrid, 0, i
'get the current cell value
strCurCellValue = objGrid.Views(0).Columns(i).EditValue
If UCase(Trim(strCurCellValue)) <> UCase(Trim(strValue)) Then
objGrid.Keys " "
End If
End Sub
Function SetFocusGridCell(objGrid, viewIndex, colIndex)
Dim blnResult
blnResult = False
If Not IsNull (objGrid) and objGrid.Exists and viewIndex >= 0 and colIndex >= 0 Then
If Not objGrid.Views(viewIndex).Columns(colIndex).Focused Then
objGrid.Views(viewIndex).Columns(colIndex).Focused = True
blnResult = True
End If
End If
SetFocusGridCell = blnResult
End Function
'code snippet to find a column index by column title "Department", I'm using View 0
Dim colIndex
Dim objGridView0
Set objGridView0 = objGrid.Views(0)
colIndex = -1
For index = 0 to objGridView0.ColumnCount-1
Select Case objGridView0.Columns(index).Caption
Case "Department" colIndex = index
Exit For
End Select
Next
'calls the function on objGrid at column index, set True
If colIndex >= 0 Then
ClickCheckboxGridColumn objGrid, colIndex, True
End If