Murray Brown
asked on
Visual Studio 2005 DataGridView - Delete row of cells programatically
Hi
I am able to add rows programatically in my DataGridView, but cannot
find out how to delete them.
Thanks
I am able to add rows programatically in my DataGridView, but cannot
find out how to delete them.
Thanks
ASKER
Hi
Thanks
I am not quite sure what you mean by ID. Please would you give me an example.
My DataGridView is simply called DGV and I want to delete line 50
Thanks
I am not quite sure what you mean by ID. Please would you give me an example.
My DataGridView is simply called DGV and I want to delete line 50
I missed - the datagridview has a rows.remove - method. So in your case, this works:
dgv.Rows.Remove(dgv.Rows(5 0))
You should also update the adapter to remove the row from the database. Like you do in your add row - routine. Ok?
dgv.Rows.Remove(dgv.Rows(5
You should also update the adapter to remove the row from the database. Like you do in your add row - routine. Ok?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Great thanks very much for that :-)
MyDataTable.Select("ID=" & DeleteFirstRowWithThisID)(