是否有可能获取文本框的值,例如,在datarepeater的第4行。我是通过将控制转移到它来实现的,但这并不是我想要的方式。我使用了代码DataRepeater1.currentIndex=5,然后选择了值。是否有可能在不将控件移动到此行的情况下获得该值。我的意思是我们从datagridview (vrName=datagridview1.item(1,1).value)获取值的方式。
谢谢弗尔坎
发布于 2011-01-18 01:21:13
您应该使用DataRepeater的BindingSource并使用MoveNext、MoveLast、MovePrevious和MoveFirst在其中导航。在那里,您可以找到您的值,而无需将控件移动到此行。
For i As Int32 = 0 To Me.AddressTableAdapterBindingSource.Count - 1
'you don't need to iterate through all rows if you have the index, this is only an example'
Dim row As DataRow = DirectCast(Me.AddressTableAdapterBindingSource(i), DataRowView).Row
Dim ID As Int32 = DirectCast(row("AddressID"), Int32)
Dim City As String = DirectCast(row("City"), String)
'you could also change the value'
row("City") = "[" & ID & "] " & City
Nexthttps://stackoverflow.com/questions/4715754
复制相似问题