c # – How to enter an element in GridView using a serial barcode without touching anything else?

The grid has 6 columns, the first column is the bar code, the second column is the quantity.
The grid has NewItemRow at the top, I need the grid to validate the barcode of the column if it is valid, fill in the following columns.
If there is already a boat, increase the amount.
I want to enter the bar code in series, without touching anything.
The barcode device sends barcodes in the format (code + enter key), but it is also possible to use the format (code + below).
barcode1 enter
barcode2 enter
barcode3 enter