删除datagridview上的选定行 [英] Removing the selected row on datagridview
问题描述
我有一个包含列的Datagridview。在最后一列中添加一个按钮。我希望当我点击特定行的那个按钮时,该行将被删除。我试过CellContentClick事件,但我找不到删除它的方法。
可以为它提供任何帮助...
谢谢.....
I have a Datagridview that contains columns. In the last column a add a button. and i want when i click on that button of a particular row then that row will be deleted. i tried in CellContentClick event but i can''t find the method to remove it.
can any one help for it...
thanks.....
推荐答案
dataGridView1.Rows.Remove(dataGridView1.SelectedRows[0]);
应该这样做。请注意,您可能需要将dataGridView上的SelectionMode设置为FullRowSelect - 我总是有这个设置,我现在还没有时间看看它是否在没有设置的情况下工作
should do it. Note that you might need the SelectionMode on the dataGridView to be FullRowSelect - I always have this set and I haven''t got time just now to see if it works without that setting
从Datagridview中删除行C# [ ^ ]
如何使用AJAX使用网格视图的HoverMenuExtender控件 [ ^ ]
这篇关于删除datagridview上的选定行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!