开发者

Getting value of a control on Datarepeater

Is it possible to get value of a text box, say at row 4 of a datarepeater. I did it by moving control to it, but that does not work the way I want. I used code DataRepeater1.currentIndex=5, and then picked the value. Is there any possibility of getting the value without moving control to this row. I mean the way we get value from datagridview (vrName=datagridview1.item(1,1).v开发者_开发百科alue)

Thanks Furqan


You should use the DataRepeater's BindingSource and navigate with MoveNext, MoveLast, MovePrevious and MoveFirst through it. There you can find your value without moving control to this row.

    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
    Next
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜