1

enter image description here

i want to input digits from virtual keyboard.

i tried by sendKeys. it not working as expected. it replace digit

dataGridViewTransation.Focus();
SendKeys.Send("{4}");

how to overcome this ?

Manu Varghese
  • 791
  • 8
  • 25

1 Answers1

0

I don't think you can append text to a DataGridView Cell. I would store the current value in a string, then update that variable before setting the text to the cell.

        private void button1_Click(object sender, EventArgs e)
    {
        //Get the currently selected Cell
        string msg = String.Format("Row: {0}, Column: {1}",
        DGV.CurrentCell.RowIndex,
        DGV.CurrentCell.ColumnIndex);

        //Update our New Cell Value Data
        newValue = newValue + "4";

        //Apply the New Cell Value Data to the Selected Cell
        this.DGV.CurrentCell.Value = newValue;
    }
K0D3R
  • 128
  • 2
  • 10