我如何...在某些特殊条件下隐藏/禁用数据网格中的按钮字段 [英] How do I...Hide/Disable Button Field from Data Grid On some Particular Conditions

查看:68
本文介绍了我如何...在某些特殊条件下隐藏/禁用数据网格中的按钮字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<asp:ButtonField ButtonType="Image" ImageUrl="~/Images/1234.JPG" CommandName="Download"

                           HeaderText="Download">
                           <ItemStyle Width="15%" HorizontalAlign="Center" CssClass="label" />
                           <HeaderStyle HorizontalAlign="center" />
                       </asp:ButtonField>

推荐答案

如果你通过添加模板字段来包含按钮控制,那么只需在按钮字段中再添加一个属性CommandArgument =<%#Eval()%>



你可以在Eval()中指定一些逻辑。
if you are including button control from by adding templete field then just simply add one more attribute in your buttonfield CommandArgument= <% #Eval( ) %>

you can specify some logic in Eval() .


这篇关于我如何...在某些特殊条件下隐藏/禁用数据网格中的按钮字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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