How do you delete rows from a datagridview.
I have a delete button to the right in the datagridview. I want to know how to delete a single row by clicking the delete button.
Exaktor
9
Light Poster
Recommended Answers
Jump to PostFirst create delete button in the grid
//I prefer to use the wizard to generate the delete button private System.Windows.Forms.DataGridViewButtonColumn Column1; this.Column1.HeaderText = "delete"; this.Column1.Name = "Column1"; this.Column1.Text = "delete"; this.Column1.UseColumnTextForButtonValue = true;
private void dataGridView1_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.ColumnIndex == 4)// …
Jump to Postcreated column index (delete button)
All 7 Replies
Ramy Mahrous
401
Postaholic
Featured Poster
Exaktor
9
Light Poster
Ramy Mahrous
401
Postaholic
Featured Poster
Aung Kaung Hein
0
Newbie Poster
unnati.bellare
0
Newbie Poster
watsonsimler
0
Newbie Poster
ChrisHunter
152
Posting Whiz in Training
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.