I Dragged a DataRepeater into my form.
Added a TextBox to the DataRepeaterItem.
Added A button to the form.
Wrote these 2 Lines of Code :
Private Sub Button1_Click(..) Handles Button1.Click DataRepeater1.VirtualMode = True DataRepeater1.AddNew() End Sub
Run Project
Press Add Button
in the textBox Write "1"
Press Add Button
in the textBox Write "2"
开发者_开发技巧Press Add Button
in the textBox Write "3"
Press Add Button
- in the textBox Write "4"
Till Here Every Thing is Fine.
Then Scroll data repeater Up
"1" Changes to default TextBox1
Why Does it happen. How can I prevent it from happening.
Thanks in Advance.
The repeater control isn't going to hold all the values by itself. In virtual mode you don't have to use a datasource, but you have to use something. In this example, they used a simple Integer array: VB.NET Repeater Simple Data Binding Without Datasource
精彩评论