Click here to Skip to main content
15,921,250 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone,

When I Dragged a DataRepeater into my form. Added a TextBox to the DataRepeaterItem. Then Added A button to the form. Write such code:

VB
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    DataRepeater1.VirtualMode = True
    DataRepeater1.AddNew()
End Sub

Then run the project,do the following steps:

Press Add Button
input into textBox "1"

Press Add Button
input into textBox "2"

Press Add Button
input into textBox "3"

Press Add Button
input into textBox "4"

Till Here Every Thing is Fine.

Then Scroll data repeater Up, "1" disappear.
Does anyone know why this happen? How can I prevent? Thanks for any suggestions.

Best regards
Posted
Updated 26-Oct-10 23:04pm
v2
Comments
Dalek Dave 27-Oct-10 5:04am    
Edited for Code Block.

1 solution

First, leaving your control names as their defaults (Button1) is a lousy idea. I have no idea if this is the Add button code or not.

Next, are you adding the contents of the textbox to a datastore somewhere? Your not doing it in the code you posted, so there's no way to tell.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900