在VB.NET中的DataGridView控件中删除一行 [英] Delete a row in DataGridView Control in VB.NET

查看:419
本文介绍了在VB.NET中的DataGridView控件中删除一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在vb.net中处理DataGridView控件。我需要帮助你,我想要
删除datagrid中的行,只有那行删除谁选择。
首先我选择行,然后删除行。
所以请提供我如何从
中选择和删除行的代码VB.NET中的DataGridView控件



谢谢

解决方案

 为每行作为DataGridViewRow在您的DGV.SelectedRows 
yourDGV.Rows.Remove(row)
下一个

这将删除所有已选择的行。


I am working on DataGridView control in vb.net. I need help you that i want to delete a row in datagrid and only that row deleted who selected. Mean first i select the row then row deleted. So please provide me code that how i select and delete row from DataGridView control in VB.NET

thank

解决方案

For Each row As DataGridViewRow In yourDGV.SelectedRows
    yourDGV.Rows.Remove(row)
Next

This will delete all rows that had been selected.

这篇关于在VB.NET中的DataGridView控件中删除一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆