问题描述
我看到了很多的ListView使用的例子,但在一个ListView中无法找到使用两个(或更多)的ItemTemplate简单,易懂的例子(如果可能)。我想定义它们的.aspx页面或使编程,并根据我的需要选择它们(针对不同的数据绑定不同的模板)。任何想法呢?谢谢你。
I saw a lot of examples of using ListView,but couldn't found simple,understandable example of using two (or more) ItemTemplates in one ListView (if it possible).I want to define them on .aspx page or to make programmatically,and,depending on my needs choose one of them (different templates for different binding data).Any idea? Thanks.
推荐答案
我希望这会帮助你实现你想要什么?
http://blogs.msdn.com/b/mikeormond/archive/2008/07/26/dynamically-loading-listview-templates.aspx
I hope this would help you achieve what you want?http://blogs.msdn.com/b/mikeormond/archive/2008/07/26/dynamically-loading-listview-templates.aspx
另外通过这个帖子有一定的洞察力,以及
<一href=\"http://forums.asp.net/t/1699218.aspx/1?ListView+ItemCommand+event+not+working+with+Dynamic+Templates\" rel=\"nofollow\">http://forums.asp.net/t/1699218.aspx/1?ListView+ItemCommand+event+not+working+with+Dynamic+Templates
Also go through this post to have some insight as wellhttp://forums.asp.net/t/1699218.aspx/1?ListView+ItemCommand+event+not+working+with+Dynamic+Templates
这篇关于几个&LT;&ItemTemplate中GT;在一个ListView控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!