如何使用网格外部的删除按钮在gridview中删除一行? [英] how to delete a row in a gridview using delete button outside the grid?

查看:71
本文介绍了如何使用网格外部的删除按钮在gridview中删除一行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网格,其中有各种记录。在我的表单上,网格外部有一个更新和删除按钮。有不同的文本框。当我在网格中选择一行时,其值将显示在这些文本框中,从中可以更新这些值。那对我来说很好。现在我要删除所选的行?
我不想使用网格中的删除按钮删除记录。我想要当我选择一行并按删除按钮时,那么所选的行也应该从网格中也从数据库中删除。

解决方案

我想如果您已经完成了更新部分,则可以轻松删除所选的行。只需调用一个delete函数,而不是更新一个,然后调用GridView的DataBind()函数。


i have a grid in which there are various records. On my form i have a Update and Delete button outside the grid. there are different textbox. when i selected a row in a grid its value appear in these textbox from where i can update these value. thats work fine for me. Now i want to delete the selected row? i dont want to delete a record using delete button in the grid. i want when i select a row and press a delete button then the selected row should delete from grid as well from database.

解决方案

I guess if you have already done the update part then you can easily delete the selected row. Just call a delete function, instead of the update one, and then call the DataBind() function of the GridView.

这篇关于如何使用网格外部的删除按钮在gridview中删除一行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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