如何禁用gridvew中的记录? [英] How to disable a record in a gridvew?

查看:136
本文介绍了如何禁用gridvew中的记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我的项目要求如果用户点击网格视图中的禁用按钮,则会禁用该记录。该记录将不再出现在网格视图中,但不应在数据库中删除。网格视图中的每条记录都有自己的禁用按钮。怎么做到的?我是Asp.Net的新手

解决方案

阅读 GridView.RowCommand事件 [ ^ ]
数据库中的
添加另一列以保存记录的禁用状态。加载时,只能加载已启用的行。在禁用按钮单击时,您可以将数据库记录更新为已禁用。


您可以向数据库表添加一个IsActive位

当您禁用记录时,该位是设置为0(false)否则为1(true)

现在只需向网格添加一个禁用按钮,并针对禁用按钮的gridview事件处理程序事件编写代码



您可以在这里阅读所有关于gridview事件处理程序的信息 GridView [ ^ ]


http:// examples -program-codes.blogspot.in/2013/04/gridview-rowcommand-with-insert-update.html [ ^ ]



这对你有帮助。

Hi,

I have a requirement in my project that if the user clicks the disable button inside the grid view, the record will be disabled. That record will not anymore appear in the grid view but it should NOT be deleted in the database.Each record in the grid view has their own Disable button. How to make that? I am new in Asp.Net

解决方案

read documentation of GridView.RowCommand Event[^]
in your database add another column to save disable status of the record. when you load you can load only the enabled rows. on disable button click you can update database record as disabled.


You can add a IsActive bit to you database table
when you disable a record, the bit is set to 0(false) else it is 1(true)
now just add a disable button to the grid and write the code against the gridview event handler event for the disable button

You can read all about gridview event handlers here GridView [^]


http://examples-program-codes.blogspot.in/2013/04/gridview-rowcommand-with-insert-update.html[^]

this will help you. .


这篇关于如何禁用gridvew中的记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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