Using Visual Studio 2008, I have a form with a datagridview. I want to use a button called BTNDelete and I need help on deleting the selected row from the datagrid then update the datatable.

Recommended Answers

All 2 Replies

Use DataGridView1.Rows.RemoveAt(DataGridView1.SelectedRows(0).Index) and remove the allow multiples rows selection from the properties of the datagrid. That should do it.

Use DataGridView1.Rows.RemoveAt(DataGridView1.SelectedRows(0).Index) and remove the allow multiples rows selection from the properties of the datagrid. That should do it.

Cool I tried it and had to motify just a little and it works thank you very much

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.