关于Container.DataItem这个是GridView上的一列.这行中的ItemInformation 是一个类,后面的Name是他的类成员.我想知道这里的Container.DataItem代表什么,为什么可以转换成ItemInformation .它不应该代表这个Gridvi

来源:学生作业帮助网 编辑:作业帮 时间:2024/07/18 02:38:32
关于Container.DataItem这个是GridView上的一列.这行中的ItemInformation 是一个类,后面的Name是他的类成员.我想知道这里的Container.DataItem代表什么,为什么可以转换成ItemInformation .它不应该代表这个Gridvi
xSN@4\hbܸpFL$Gw| 1Qfta]p7=sQq4ҳ'2U糉${?#==2ʒ W"扌U(8z^_MejVKS؃(lzy5?B TOejVi՛,O!-kk)'(#_> }"C'G"8j [ZהL[;C~gC?7!ݴKǕAp*ʨmװ1p1VZQאC(z'(wE;(?H+XĊnϭBf@=bGT%.|Mf=#t{H`^:@ F.Z]`%8l;~hFB&_pH˓ 30!Ͻwedr3 ^ @Bk`CVbkiUb

关于Container.DataItem这个是GridView上的一列.这行中的ItemInformation 是一个类,后面的Name是他的类成员.我想知道这里的Container.DataItem代表什么,为什么可以转换成ItemInformation .它不应该代表这个Gridvi
关于Container.DataItem
这个是GridView上的一列.
这行中的ItemInformation 是一个类,后面的Name是他的类成员.
我想知道这里的Container.DataItem代表什么,为什么可以转换成ItemInformation .它不应该代表这个Gridview中的一列么?

关于Container.DataItem这个是GridView上的一列.这行中的ItemInformation 是一个类,后面的Name是他的类成员.我想知道这里的Container.DataItem代表什么,为什么可以转换成ItemInformation .它不应该代表这个Gridvi
GridView的每一行都是一个类型为GridViewRow的Container(容器)对象.GridViewRow有一个属性叫DataItem,它是GridViewRow对象绑定到的基础数据对象,一般来说它就是绑定到GridView的关系数据库数据源的一行(DataRow).
在上面的例子中,因为GridViewRow(即GridView的一行)通过原先的数据绑定已经绑定到了一个ItemInformation对象,所以Container.DataItem可以转换为temInformation.
总之,Container是GridView的一行,而Container.DataItem是这一行所绑定的数据.