Generating KeyPress in DataGridView control

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • NayJo

    #1

    Generating KeyPress in DataGridView control

    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


  • srikant

    #2
    Re: Generating KeyPress in DataGridView control


    On Jan 14, 8:13 pm, "NayJo" <CrawNOSPAMforM Ef...@mindsprin g.com>
    wrote:
    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.Co lumnNumber==3)
    {

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

    Comment

    Working...