Question : problem with AccountsGrid_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles AccountsGrid.CellContentClwbr

I wish to implement the following which is OK but what seems to happen is that when I click any cell, changes to the text box entries occur only after clicking in columns 5 or 6  of the datagrid view and nowhere else. What am I doing wrong?I have included an image of the windows form
David Jenkins

Private Sub AccountsGrid_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles AccountsGrid.CellContentClick
 
        Dim row As DataRow
 
        If e.RowIndex >= 0 Then 'And e.ColumnIndex >= 0 Then
            ClassGlobalVariables.cBookMarkInt = e.RowIndex
            row = ClassGlobalVariables.cDataTable.Rows(e.RowIndex)
            '**************************************************************
            'link textboxes, etc to the datagrid first tab
            cTitle.Text = row(TitlePFX)
            cForename.Text = row(Forename)
            cInitial.Text = row(CurrencyDeleteInd)
            cSurname.Text = row(surname)
            cAccountUID.Text = row(AccountUIDRef)
            cBusinessName.Text = row(BusinessName)
            AccountID.Text = row(AccountUID)
 
            If row(AccountStartDt) IsNot Nothing Then
                cAccountStartDt.Text = String.Format("{0:d}", row(AccountStartDt))
            Else
                cAccountStartDt.Text = ""
            End If
 
            If row(AccountEndDt) IsNot Nothing Then
                cAccountEndDt.Text = String.Format("{0:d}", row(AccountEndDt))
            Else
                cAccountEndDt.Text = ""
            End If
 
            cAccountType.Text = row(AccountType)
            cDifficultyRating.Text = row(AccountDifficultyRating)
            cAccountStatus.Text = row(AccountStatus)
            cBillCycleCode.Text = row(BillCycleCode)
            cDirectDebtDay.Text = row(DirectDebitDay)
            cPlanCode.Text = row(PlanCode)
            cPlanSeries.Text = row(PlanSeries)
 
            If row(CollectionStartDt) IsNot Nothing Then
                cCollectionStartDt.Text = String.Format("{0:d}", row(CollectionStartDt))
            Else
                cCollectionStartDt.Text = ""
            End If
 
            If row(CollectionEndDt) IsNot Nothing Then
                cCollectionEndDt.Text = String.Format("{0:d}", row(CollectionEndDt))
            Else
                cCollectionEndDt.Text = ""
            End If
 
            cSuspendInd.Text = row(SuspendInd)
            cDeleteInd.Text = row(DeleteInd)
            If row(CreditScore) IsNot Nothing Then
                cCreditScore.Text = row(CreditScore).ToString
            Else
                cCreditScore.Text = ""
            End If
            cCreditLimit.Text = row(CreditLimit).ToString
            If IsDBNull(row(AccountNote)) Then
                cAccountNote.Text = ""
            Else
                cAccountNote.Text = row(AccountNote)
            End If
 
 
            '****************************************************************
 
            bmkAccountUIDRef = row(AccountUIDRef)
            ClassGlobalVariables.cBookMarkInt = row(AccountUIDRef)
            bmkAccountUIDRefIndex = AccountsGrid.CurrentCell.RowIndex
            ClassGlobalVariables.cBookMarkIntIndex = bmkAccountUIDRefIndex
        Else
            'nothing
        End If
 
    End Sub
 
 
 
 
 

Answer : problem with AccountsGrid_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles AccountsGrid.CellContentClwbr

You can also use Cell click,Mouse Click ,Mouse Double Click with the same results.....
Random Solutions  
 
programming4us programming4us