471,356 Members | 1,554 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,356 software developers and data experts.

How do I delete a row in a DataGrid ?

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
Jul 21 '05 #1
2 970
Use the delete method of row collection

regards
Nishith Pathak
http://dotnetpathak.blogspot.com

"Unemployed Programmer" wrote:
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

Jul 21 '05 #2
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
Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by laurent | last post: by
5 posts views Thread by Jeff User | last post: by
reply views Thread by rn5a | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.