需要一些关于网格视图的帮助 - 激活和停用链接按钮 [英] Need some help regarding Grid View-Activating and deactivating link buttons

查看:75
本文介绍了需要一些关于网格视图的帮助 - 激活和停用链接按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有一个网格视图,显示来自数据库表的图像。

它有两列,一列用于显示图像,另一列用于操作按钮...

有一个动作按钮可激活和停用图像

如果标志为零,我想启用停用按钮,或者当标志为1时启用激活按钮

any想法,怎么做?

谢谢

Hi I have a grid view showing images from database table.
It has two columns, one is for showing images and another for one for action button...
there is one action button to activate and deactivate image
I want to enable deactivate button if flag is zero or enable activate button when flag is one
any idea, how to do that?
thanks

推荐答案

解决方案1:将LinkBut​​ton的Enabled属性绑定到数据库中的flag字段。



解决方案2: RowDataBound GridView行绑定时会触发事件。您可以使用此活动。您将基本上获取标志的值,找到您的控件并根据标志值启用/禁用它。有关此活动的更多信息,请参阅 MSDN [ ^ ]。
Solution 1: Bind the Enabled property of the LinkButton to the flag field from the database.

Solution 2: RowDataBound Event is fired when a GridView row gets bound. You can use this event. You will basically get the value of the flag, find your control and enable/disable it based on the flag value. Read more on this event in MSDN[^].


看到这个:



http://stackoverflow.com/questions/18001632/enable-disable-link-buttons-in-gridview-depending-on-condition [ ^ ]





http://go4answers.webhost4life.com/Example/disable-link-button-grid-view-clicked-98536.aspx [ ^ ]
see this:

http://stackoverflow.com/questions/18001632/enable-disable-link-buttons-in-gridview-depending-on-condition[^]

and
http://go4answers.webhost4life.com/Example/disable-link-button-grid-view-clicked-98536.aspx[^]


这篇关于需要一些关于网格视图的帮助 - 激活和停用链接按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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