'System.Data.DataRowView'不包含名称为'Selected'的属性 [英] 'System.Data.DataRowView' does not contain a property with the name 'Selected'

查看:83
本文介绍了'System.Data.DataRowView'不包含名称为'Selected'的属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

< itemtemplate>
< asp:CheckBox ID ="CheckBox1" runat ="server" Checked =''<%#DataBinder.Eval(Container,"DataItem.Selected")%>''/>


谁能告诉我我在哪里做错了.
我也尝试过
DataBinder.Eval(Container.DataItem,"Selected")

它引发主题中提到的异常
``System.Data.DataRowView''不包含名称为``Selected''的属性

供我参考的依据:
http://www.ilearnttoday.com/c-aspnet-gridview-select-multiple-rows-in-a-grid-view-using-check-boxes

<itemtemplate>
<asp:CheckBox ID="CheckBox1" runat="server"Checked=''<%#DataBinder.Eval(Container,"DataItem.Selected") %>'' />


can anyone plz tell me where I m doing it wrong.
I have also tried
DataBinder.Eval(Container.DataItem,"Selected")

it throws an exception mentioned in subject
''System.Data.DataRowView'' does not contain a property with the name ''Selected''

for reference I m working on the basis of this article:
http://www.ilearnttoday.com/c-aspnet-gridview-select-multiple-rows-in-a-grid-view-using-check-boxes

推荐答案

此错误表示您的VS工作正常.
选定的不是"System.Data.DataRowView"的属性.
复选框的已选中"属性应该为true或false.
this error means that your VS is working fine.
Selected is not a property of ''System.Data.DataRowView''.
"Checked" property of checkbox should either be true or false.


根据您提供的链接,已选中"必须是以下属性(复选框将绑定到该属性)数据源.在实施之前,请先完整阅读(并理解)本文.还请提及您要实现的目标.
As per the link you provided, "Selected" must be a property (to which the check-boxes will be bound) in the DataSource. Please read (and understand) the article completely before implementing. Also please mention what are you trying to achieve.


这篇关于'System.Data.DataRowView'不包含名称为'Selected'的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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