Generating KeyPress in DataGridView control

N

NayJo

I am writing a .NET 2.0 Windows Form app that accepts either keyed or
scanned data via a barcode scanner via SerialPort into one column of a
DataGridView control.

The program handles scanned input just fine but I want to simulate a tab key
or an enter key being pressed so I can trigger the validating event.

How would I do this?

mtia
 
S

srikant

I am writing a .NET 2.0 Windows Form app that accepts either keyed or
scanned data via a barcode scanner via SerialPort into one column of a
DataGridView control.

The program handles scanned input just fine but I want to simulate a tab key
or an enter key being pressed so I can trigger the validating event.

How would I do this?

mtia

DataGrid has Keyup and Key down event
eg. for checking the space from keyboard
if(e.KeyValue==32)
{
if(dbgrdReports.CurrentCell.ColumnNumber==3)
{

}
here i am check if the key board event is space than i am doing the
things
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top