Remove carriage return from barcode scan into textbox column in dataGridView
Posted on 2009-12-22
The user is using a barcode scanner that has a carriage return, to scan a barcode into a dataGridView textbox column. I need to remove that carriage return so the focus stays in the current cell after the scan. I know I can do a string.replace to remove the "\r\n" but I cannot catch it in the correct event. Any ideas?
Key down, key press and key up events do not work as it is too the the carriage return already executed and the focus is in the new row. I was thinking CellBeginEdit or CellValidating but don't know how I could strip off the carriage return in those events?