c# - Delete GridView Row in Windows Forms -
i have gridview , in each item of grid have button use delete row of these button. not working.
private void grvorders_cellcontentclick(object sender, datagridviewcelleventargs e) { var sendergrid = (datagridview)sender; if (sendergrid.columns[e.columnindex] datagridviewbuttoncolumn && e.rowindex >= 0) { grvorders.rows.remove(sender); } }
anyone me?
your problem can't remove sender: it's not datagridviewrow
. instead, use grvorders.rows.removeat(e.rowindex);
.
Comments
Post a Comment