Click here to Skip to main content
16,018,805 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Problem

When access cell quantity then press enter go to Last Empty Row and focus on First cell(Code) in empty row .

meaning i need move from current row to last empty row first cell focus of Code on that empty row

details

I have datagridview have 4 column

Code  Name  Quantity  Price
122   pen      5        12
EmptyRow

meaning when read barcode it reading barcode and add empty row .

Actually i need when access cell quantity that have value 5 and click enter go to next row empty that already exist and focus on cell code

How to do that please BY CODE?

I need when access cell quantity then enter not add row only focus to empty row first cell code and focus on that cell the empty row already added after every reading by barcode machine . It take too much time to move by cursor mouse from first row to next row first cell focus so that this rapidly .

What I have tried:

When access cell quantity then press enter go to Last Empty Row then focus First cell(Code) in Datagridview
Posted
Updated 4-Sep-18 21:03pm
v2
Comments
Sinisa Hajnal 5-Sep-18 2:16am    
There is a property on the grid and event for key press. Intercept enter and current cell to (last row, 0) <- you can get last row by datagrid.RowCount property.
Matias Lopez 7-Sep-18 13:13pm    
Yes, and you can use the function "Select(int iRow)"!
Maciej Los 5-Sep-18 3:05am    
What have you tried till now?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900