如果某些状态存在则如何显示消息然后在gridview中不删除 [英] How to show message if some status is exists then dont delete in gridview
本文介绍了如果某些状态存在则如何显示消息然后在gridview中不删除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在标签上显示消息。如果某个状态存在则不删除gridview中的数据,如果状态不存在gridviw中的删除选择删除按钮,任何人都可以帮助我吗?
How to show message on a lable . if some status is exists then dont delete data within gridview , if status is not exsits the delete selected delete button in gridviw ,anybody can help me ?
推荐答案
虽然您的输入太少而无法回答。假设状态CanDelete
现在来自数据库,则删除按钮的可见性将取决于此状态位。在Gridview的ItemCommand事件上
Hi,
Though your inputs are too few for an answer. Assuming a statusCanDelete
is coming from database now a Delete button's visibility will be depending on this status bit. On ItemCommand Event of the Gridview
<asp:linkbutton id="lnkDelete" runat="server" text="Delete" commandname="DeleteRecords" commandargument="<%# Eval("ID")%>" visible="<%# Convert.ToString(Eval("CanDelete"))%>" xmlns:asp="#unknown" />
protected void LstFeedbackForms_OnItemCommand(object sender, GridViewCommandEventArgs e)
{
try
{
if(_ObjE.CommandName=="DeleteRecords")
{
//Delete code here
}
}
}
如果您的状态为false,则删除按钮不会显示。
希望这对您有帮助。
Here the delete button will not show if your status is false.
Hope this will help you.
这篇关于如果某些状态存在则如何显示消息然后在gridview中不删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文