Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

datagridview delete selected row, but remove two rows

$
0
0

Hello, I am working on database recently, I read data from database and fill in the datagridview. when I want to delete one row selected, anytime I run, two rows will be deleted. Could somebody help me?

my code is as following.

if (dgvRecipeData.SelectedRows.Count > 0)
            {
                dgvRecipeData.Rows.RemoveAt(dgvRecipeData.SelectedRows[0].Index);
            }


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>