在asp.net中隐藏网格视图中的特定按钮 [英] Hide particular button from grid view in asp.net
本文介绍了在asp.net中隐藏网格视图中的特定按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好朋友
有没有办法隐藏网格视图中的特定按钮?
i在网格视图中有一个命令按钮用于保存记录,如果用户点击该按钮,那么记录将被保存,我必须从网格视图中隐藏/禁用该按钮
Hello friends
is there any way to hide particular button in grid view ?
i have a command button in grid view for save the record, if user clicks that button then record will be saved and i have to hide / disable that button from grid view
推荐答案
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
Button btn_hide= (Button)e.Row.FindControl("btnedit");
// btn_edit is你希望在GridView中隐藏的按钮
//这是你想要获得的控件..如按钮,la bel ..你想要的任何东西
btn_hide.visible = false
}
//btn_edit is id Of the Button which you want to hide in GridView
//this your control which you want to Get.. like button,label.. anything you want
btn_hide.visible=false
}
看看这个
如何-可以-I-禁用隐藏编辑按钮功能于gridview的 - 控制 - 的-ASP-净 [ ^ ]
这篇关于在asp.net中隐藏网格视图中的特定按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文