Gridview列可以根据条件采取不同的行为 [英] Can Gridview column acts differently based on conditions
本文介绍了Gridview列可以根据条件采取不同的行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
早上好专家,
Gridview中的列可以根据条件采取不同的行动吗?意思是,我想要下面的东西
我的上一栏应该显示一个文件,如果在数据库中存在下载链接按钮如果不是像一个按钮要求你想附上档案吗?
我们可以达到这样的目的吗?如果有,请告诉我如何。
Good morning Experts,
Can a column in Gridview act differently based on conditions? Meaning, I want something like below
My last column should show a File if exists in Database as "Download" Link button" If not like a "Button" asking for "Do you want to attach a file"
Can we achieve something like this? If so please tell me how.
推荐答案
作为RyanDev评论,您可以使用GridView RowDataBound事件,对于示例代码,请查看下面类似的问题和答案
GridView条件按钮可见性 [ ^ ]
并查看网格视图。 RowDataBound事件 [ ^ ]
As RyanDev Commented, you can use GridView RowDataBound event, for sample code, check below similar question and answer
GridView Conditional Button Visibility[^]
and also check the MSDN documentation of GridView.RowDataBound Event[^]
这篇关于Gridview列可以根据条件采取不同的行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文