本文介绍了在DataGridView中删除行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我使用下面的代码来删除datagridview中的行,但它不会删除行,直到计算它正在删除某行未取消删除我的代码是Hi,I am using below code to delete row in datagridview but it is not deleting row till count it is lefting some row undeleted my code isAppiRow=datagridview.currentcell.rowindex;for (int AppiLib_Count = 0; AppiLib_Count < AppiLib.Count; AppiLib_Count++) { dataGrid.Rows.RemoveAt(AppiRow); AppiRow++; } 请帮忙...please help on this..推荐答案OnRowDeleting="Countrylist_Rowdelete" gridview的方法 IN .cs文件 method of gridviewIN .cs fileprotected void Countrylist_Rowdelete(object sender, GridViewDeleteEventArgs e)//TO DELETE PARTICULAR RECORD SELECTED FROM GRID { int intCode = Convert.ToInt32(Countrylist.DataKeys[e.RowIndex].Value); strQuery = "DELETE FROM Country_master " + "WHERE CountryId=" + intCode + ""; OpenConn(); OleDbCommand oledbcmd = new OleDbCommand(strQuery, con); oledbcmd.ExecuteNonQuery(); Display();//function that binds your gridview } 希望这可以帮到你 Happy Coding:)Hope this may help youHappy Coding :) 这篇关于在DataGridView中删除行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-15 11:49