如何使用网格外的删除按钮删除网格视图中的行?
我有一个网格,其中有各种记录。在我的表单上,我在网格外有一个更新和删除按钮。有不同的文本框。当我在网格中选择一行时,其值出现在这些文本框中,我可以从中更新这些值。这对我来说很好用。现在我想删除选定的行? 我不想使用网格中的删除按钮删除记录。我希望当我选择一行并按删除按钮时,所选行也应该从网格中删除以及从数据库中删除。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想如果您已经完成了更新部分,那么您可以轻松删除所选行。只需调用删除函数(而不是更新函数),然后调用 GridView 的 DataBind() 函数即可。
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.