
May 19th, 2003, 03:49 PM
|
|
Contributing User
|
|
Join Date: Nov 2001
Location: USA
Posts: 312
Time spent in forums: 3 h 27 m 43 sec
Reputation Power: 7
|
|
|
DataGrid total column count
Here is a question in VB6 you could do something like this to go through all the cells in a MSHFlexGrid1
PHP Code:
With MSHFlexGrid1
For iCol = 0 To MSHFlexGrid1.Cols - 1
If iCol = 1 Then
mstTitle = .TextMatrix(iRow, iCol)
End If
If iCol = 2 Then
mstDescription = .TextMatrix(iRow, iCol)
End If
If iCol = 13 Then
mstRecordID = .TextMatrix(iRow, iCol)
GetRecordID
End If
stColumnHeader = MSHFlexGrid1.ColHeaderCaption(0, iCol) & ": "
stDisplayText = stDisplayText & stColumnHeader & .TextMatrix(iRow, iCol) & vbCrLf & vbCrLf
Next
End With
Now in VB.NET I am trying to do something like that when a user clicks a cell in a DataGrid.
PHP Code:
With DataGrid2.Item(iCol, iRow)
For iCol = 0 To DataGrid2.VisibleColumnCount
stColumnHeader = DataGrid2.CaptionVisible.ToString & ": "
stDisplayText = stDisplayText & stColumnHeader & DataGrid2.Item(iRow, iCol) & vbCrLf & vbCrLf
Next
End With
But in this line "For iCol = 0 To DataGrid2.VisibleColumnCount" instead of DataGrid2.VisibleColumnCount I want the total column count any ideas?
|