加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – 什么是Container.DataItem?

发布时间:2020-12-15 18:42:22 所属栏目:asp.Net 来源:网络整理
导读:什么是Container.DataItem? 解决方法 This article可能会帮助您了解。引用: So what is this expression exactly? The %# % means this is a DataBinding expression and Container.DataItem is an alias for the current item in the datasource. In othe
什么是Container.DataItem?

解决方法

This article可能会帮助您了解。引用:

So what is this expression exactly? The <%# %> means this is a
DataBinding expression and Container.DataItem is an alias for the
current item in the datasource. In other words,if you are binding to
a collection of objects Container.DataItem is the current row of that
collection.

This blog entry给出了何时使用的帮助。引用:

Container.DataItem is a runtime alias for the DataItem for this
specific item in the bound list. For a grid which displays 10 rows of
data,this is one row from the datasource. The actual type of
DataItem is determined by the type of the datasource. For example,if
the datasource is a Dataview,the type of DataItem is DataRowView. If
the type of the datasource is an array of strings,the type of
DataItem is String. If the datasource is a collection of
strongly-typed objects (for example “Employees” objects),the type of
DataItem is Employees.

Each of these cases requires a slightly different databinding expression,with further differences between VB and C#.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读