Need Help in DatagridView ComboBox Coloumn

Joined
Sep 26, 2011
Messages
7
Programming Experience
Beginner
I M new to Vb.Net
In an Project I have form Containg Datagridview which contains one ComboBox & Two textboxes.
Naming Combobox as Account Displaying all Account Names in Database
1st Text_Box as Debit_Amount & 2nd Text_Box as Credit_Amount

My Problem Is I want to enable the Credit_Amount Text Box only if Debit_Amount is Blank & my cursor moves to the Next row of my DatagridView.....
This Form allows to make a Journal Entry in an Accounting System..

Can Any one Help.........
Plssss
 
I would leave them both enabled all the time. Handle the CellValueChanged event of the grid to detect changes in both columns. If the value of one cell changes to a non-blank value, clear the other one.
 
Thanks For the Reply....
Ur Suggestion realy Helped ME.....

But there is an another Problem
Credit_Amount Text Box gets Readonly if Debit_Amount is not Blank
but what i need is my cursor within the Grid Should move Automatically to another row Instead moving to Credit_Amount
Can this Be possible

VB.NET:
Private Sub dgvJournalEntry_CellEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvJournalEntry.CellEnter

If dgvJournalEntry("txtDebitamount", e.RowIndex).Value <> 0 Then
dgvJournalEntry.Rows(e.RowIndex).Cells("txtCreditAmount").ReadOnly = True
'dgvJournalEntry.CurrentCell = dgvJournalEntry.CurrentRow.Cells(2)
Else
dgvJournalEntry.Rows(e.RowIndex).Cells("txtCreditAmount").ReadOnly = False
End If

End Sub

plss Help...
 
Last edited:

Latest posts

Back
Top