从 GridView 获取 RepositoryLookupEdit
我想迭代 gridview 中的所有行并从 RepositoryLookupEdit 检索数据。
基本上我想这样做,但我不知道如何获取 RepositoryLookupEdit:
For i as Int32 = 0 to myGridView.RowCount -1
Dim row As DataRowView = CType(myGridView.GetRow(i), DataRowView)
//'This next line does not work
Dim lue As LookUpEdit = row.Item("myColumn").myRepLookupEdit
Dim drv As DataRowView = CType(editor.Properties.GetDataSourceRowByKeyValue(lue.EditValue), DataRowView)
Dim myData As Int32 = CType(drv("myData"), Int32)
Next
I'd like to iterate through all the rows in a gridview and retrieve data from RepositoryLookupEdit.
Basically I'd like to do this, but I don't know how to get the RepositoryLookupEdit:
For i as Int32 = 0 to myGridView.RowCount -1
Dim row As DataRowView = CType(myGridView.GetRow(i), DataRowView)
//'This next line does not work
Dim lue As LookUpEdit = row.Item("myColumn").myRepLookupEdit
Dim drv As DataRowView = CType(editor.Properties.GetDataSourceRowByKeyValue(lue.EditValue), DataRowView)
Dim myData As Int32 = CType(drv("myData"), Int32)
Next
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您应该使用以下代码:
这对您有用吗?
I think that you should use the following code:
Does this work for you?