datagridview
-
Hi all How can i add a column to mydatagridview in code that the duty of this row is deleting the current row?
Basically you need to create a column and add it to the columns collection. As far as it's duty, I have no idea what you are talking about!
CQ de W5ALT
Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software
-
Basically you need to create a column and add it to the columns collection. As far as it's duty, I have no idea what you are talking about!
CQ de W5ALT
Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software
-
Thanks for your help; I mean that I want a column for deleting the current row that has been clicked; Additionally i want a gridview that has a deleting ability and i want to add this ability to my datagrtidview in code.
Well, in my applications, selecting the row header and pressing the delete key deletes the row. If you need something different, then maybe using a checkbox or button column and doing the delete when that is selected would work, but it seems convoluted to me. Or maybe I still don't understand what you want to do?
CQ de W5ALT
Walt Fair, Jr., P. E. Comport Computing Specializing in Technical Engineering Software
-
Hi all How can i add a column to mydatagridview in code that the duty of this row is deleting the current row?
Hi, add a ButtonColumn to DataGridView and name it like Colremove then write code for dataGridView CellContentClick event like shown below
private void dataGridView1\_CellContentClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex > -1) { if (e.ColumnIndex == dataGridView1.Columns\["dataGridView1.Colremove"\].Index) { dataGridView1.Rows.RemoveAt(e.RowIndex); } } }
modified on Friday, December 18, 2009 1:55 PM