Mayank Jani

Mayank Jani

  • NA
  • 477
  • 77.5k

ComboBox PreviewKeyDown event problem.

Nov 26 2017 1:31 PM
Dear All,
 
Greetings of the day.
 
I am working on a C# WinApp and I have a WinForm that contains a ComboBox and a DataGridView. I have write code that when I press Enter key on an item of the combobox that items shows in the gridview. but it shows the same item twice with one blank row.
 
Apart from this there is code for remove a row from the datagridview, it works but, when click on the blank row it throws an error.
 
please see the screen shots attached to see both the code and result.
 
Please help me to correct where I am mistaking. I want to get the code rectified that when I press enter on an item from the combobox, the same item should be shown in the gridview only.
 
Thank You...
 
Mayank Jani

Attachment: Problems.zip

Answers (11)