How do I delete a row in a DataGrid ?

  • Thread starter Unemployed Programmer
  • Start date
U

Unemployed Programmer

I have a form that has an SqlConnection, SqlDataAdapter & DataSet as
components, and a DataGrid control that has this DataSet as the DataSource.

I do sqlDataAdapter1.Fill( dataSet11, "tableName" ), and the control fills up
properly. I do an update by typing in a new value in a grid, then have a
button click event do sqlDataAdapter1.Update( dataSet11, "tableName" ), and it
updates the datebase. I add a new row to the DataGrid by clicking on the "*"
button, then the Update() call, and it updates the datebase.

But I can't figure out how to delete a row from the grid!

Please help. Thanks
 
C

Cor Ligthert

Hi,

I don't like it however it is the Alt Del (or ctrl del I always forget which
of the two and try) :).

I think that it is better to put a delete button on your form.

I hope this helps,

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top