radListview telerik 访问服务器端绑定上的对象
我有一个 telerik listview 的对象数据源,在 onitemcreated 方法上我希望能够提取它所在的当前对象。谁能帮助我吗?谢谢
I have a object datasource for a telerik listview and on the onitemcreated method I want to be able to pull out that current object that it is on. can anyone help me? Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法在
OnItemCreated
中访问数据对象,因为这发生在任何数据绑定发生之前。相反,您应该在OnItemDataBound
中进行处理。您可以使用这样的逻辑:Telerik 有一个 其文档中的页面专门解决了
ItemCreated
和ItemDataBound
事件之间的差异。这是其中的一个片段:You cannot access the data object in
OnItemCreated
because that occurs before any data binding occurs. Instead, you should do you processing inOnItemDataBound
. You can use logic like this:Telerik has a page in their documentation specifically addressing the differences between the
ItemCreated
andItemDataBound
events. Here is a snippet of that: