Windows datagridview editing/deleting

Posted by Jeena under C# on 8/16/2012 | Points: 10 | Views : 43631 | Status : [Member] | Replies : 3
hi all

Is it possible for us to do edit/delete/update in datagridview for windows applications?
any links for reference is fine




Responses

Posted by: Arvsingh85 on: 8/16/2012 [Member] Starter | Points: 25

Up
0
Down
To Delete Row Wise Data Write On datagridview1_KeyDown
this.datagridview1.Rows.RemoveAt(this.datagridview1.CurrentCell.RowIndex);

To Update /Edit
this.EditData(this.datagridview1.CurrentCell.RowIndex);
EditData()
{
this.txtcode.Text = this.this.datagridview1.Rows[this.RowIndex].Cells["Code"].Value.ToString().Trim();
}


arvind singh

Jeena, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Kianurieves on: 9/11/2012 [Member] Starter | Points: 25

Up
0
Down
The Data Grid View will use the Sql Data Adapter Update method to save the values to database.And user can select the whole row, and then just use a "Delete" key to delete this row. If you also want a button after that row and use it to delete the row, then you will need to know how to host a control into the cell.For more details read ithttp://www.dapfor.com/en/net-suite/net-grid/tutorial/data-sorting

Jeena, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response