Home Forums WinForms controls Xceed Grid for WinForms Determining which row you have just clicked into Reply To: Determining which row you have just clicked into

User (Old forums)
Post count: 23064

Never mind! Appearantly, my mind isn’t focussing very well today. Here is what I did to resolve this:

Private Sub gcPrimary_SelectedRowsChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles gcPrimary.SelectedRowsChanged
Dim drRow As Data.DataRow
Dim drLoop As Data.DataRow
Dim dv As DataView
Dim lngRow As Long
Dim blnRowFound As Boolean

lngRow = gcPrimary.SelectedValue
For Each drLoop In m_dtCaseEntries.Rows
If drLoop.Item(“JournalEntriesID”) = lngRow Then
drRow = drLoop
blnRowFound = True
Exit For
End If

If blnRowFound Then
If drRow.Item(2).ToString = clsSQLLogin.UserID.ToString Then
‘User matches, so is allowed to edit.
Me.gcPrimary.ReadOnly = False
‘User doesn’t match, so they can’t edit
Me.gcPrimary.ReadOnly = True
End If
‘This means it’s a new entry and anyone should be allowed to type in the field.
Me.gcPrimary.ReadOnly = False
End If
End Sub

Imported from legacy forums. Posted by DimondWoof (had 3783 views)