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

Amit GuptaRank #190 · 12.8K reputationPosted Nov 27, 2017, 4:18 AM EST
Mayank JaniRank #2,449 · 575 reputationPosted Nov 27, 2017, 8:14 PM EST
Mayank JaniRank #2,449 · 575 reputationPosted Nov 29, 2017, 8:24 AM EST
Amit GuptaRank #190 · 12.8K reputationPosted Nov 29, 2017, 9:41 AM EST
Mayank JaniRank #2,449 · 575 reputationPosted Nov 30, 2017, 7:43 AM EST
Amit GuptaRank #190 · 12.8K reputationPosted Nov 30, 2017, 1:30 PM EST
Mayank JaniRank #2,449 · 575 reputationPosted Dec 1, 2017, 7:30 PM EST
Amit GuptaRank #190 · 12.8K reputationPosted Dec 1, 2017, 10:33 PM EST
Mayank JaniRank #2,449 · 575 reputationPosted Dec 4, 2017, 7:18 AM EST
Amit GuptaRank #190 · 12.8K reputationPosted Dec 4, 2017, 11:37 AM EST
Mayank JaniRank #2,449 · 575 reputationPosted Dec 11, 2017, 8:03 AM EST
dt.Rows.Add(cmbItems.SelectedText);