|
-
June 28th, 2012, 11:58 AM
#2
Re: Datagridview
You'll need to skip line 0, then start comparing ircNo+1 to ircNo each time, unless it's an odd number of items. Might need another condition to handle that
Code:
If e.Button Is ToolBarButton1 Then
Dim irowNo As Integer, OldValue as String
For irowNo = 0 To DgvPracExcl.Rows.Count - 1
if rowNo = 0 Then
oldValue = "None"
else
oldValue = oldValue
End If
If DgvPracExcl.Rows(irowNo).Cells(2).ToString() = "old" Then ' or the correct string to compare?
oldValue = DgvPracExcl.Rows(irowNo).Cells(2).ToString()
End If
' Now compare
If DgvPracExcl.Rows(irowNo).Cells(2).ToString() = oldValue
DgvPracExcl.Rows(irowNo).Cells(3).ReadOnly = True
Else
DgvPracExcl.Rows(irowNo).Cells(3).ReadOnly = False
End If
Next irowNo
Free-hand...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|