如何将控件动态添加到GridView以及如何将控件与数据库绑定 [英] How to add controls to GridView dynamically and bind controls with database
本文介绍了如何将控件动态添加到GridView以及如何将控件与数据库绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我想使用GridView来显示数据,但我想动态地将控件添加到GridView中,例如LinkButtons和Labels,
我想将不带控件的数据库数据绑定到GridView,而将控件动态添加到GridView,
那有可能吗??我希望文章对此进行解释,或者是一个很好的代码示例.
感谢
Hi guys,
I want to use GridView to display data but i want to add controls to GridView dynamically like LinkButtons and Labels,
I want to bind data from database with controls not to GridView and add the controls to GridView dynamically,
Is that is possible ?? I want article explain that or an good example with code.
Thanks
推荐答案
该网站上有不错的文章.您的问题将是从这些控件获取事件.您可以轻松地创建用于创建控件的模板,但是同样,事件将是一个问题,在页面加载之前,控件需要存在于控件树中才能触发.
There''s good articles on this site. Your issue will be getting events from those controls. You can easily create a template that creates controls, but again, events will be an issue, the controls need to exist in the control tree BEFORE page load, for them to fire.
这篇关于如何将控件动态添加到GridView以及如何将控件与数据库绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文