views:

11

answers:

1

Hi,

  1. I Dragged a DataRepeater into my form.

  2. Added a TextBox to the DataRepeaterItem.

  3. Added A button to the form.

  4. Wrote these 2 Lines of Code :

    Private Sub Button1_Click(..) Handles Button1.Click DataRepeater1.VirtualMode = True DataRepeater1.AddNew() End Sub

  5. Run Project

  6. Press Add Button

  7. in the textBox Write "1"

  8. Press Add Button

  9. in the textBox Write "2"

  10. Press Add Button

  11. in the textBox Write "3"

  12. Press Add Button

  13. 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.

A: 

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: http://stackoverflow.com/questions/926619/vb-net-repeater-simple-data-binding-without-datasource

Jeff O