界域值 [英] Bound field value

查看:75
本文介绍了界域值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在网格视图中有一个与DataField ="Status"绑定的字段..
现在在我的代码页中,我想访问该值..
我正在尝试

I have one bound field with DataField="Status" in grid view..
now in my code page i want to access that value..
i am trying as

BoundField Status= (BoundField)e.Row.FindControl("Status");



其给定错误



its giving error

推荐答案

我认为绑定字段本身没有任何ID.

如何应用状态"(绑定字段的ID)?

并且Bound Filed将自己呈现为< td>元素.

因此,我认为您可能会找到(如果是复选框)

I think the Bound Field itself doesn''t have any ID.

How you have Applied "Status"(id of Bound Field) ?

and Bound Filed renders itself as a <td> Element.

So I think you can probably find ( if it is checkbox )

CheckBox cBox =  gridView.Rows[0].Cells[0].Controls[0] as CheckBox;



如果有帮助,请 投票 接受答案 .



Please vote and Accept Answer if it Helped.


BoundField是是否可用取决于您要在哪里访问BoundField?

您可能对这个
BoundField is available depending on Where are you trying to access BoundField?

You might be interested in this




我了解的是您要在rowdatabound中访问此控件

您可能缺少行类型检查.



what i understand is that you are accesing this control in rowdatabound

you might be missing row type check.

e.Row.RowType = DataControlRowType.DataRow



有关详细信息,请检查
http://forums.asp.net/p/1088037/1624163.aspx [ ^ ]

谢谢



for details pleaese check
http://forums.asp.net/p/1088037/1624163.aspx[^]

thanks


这篇关于界域值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆