文本消失在DataRepeater的TextBox上 [英] Text disappear on the TextBox on the DataRepeater

查看:81
本文介绍了文本消失在DataRepeater的TextBox上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

当我将DataRepeater拖入表单时.在DataRepeaterItem中添加了一个TextBox.然后在表单中添加了一个按钮.编写这样的代码:

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:

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


然后运行项目,执行以下步骤:

按添加按钮
输入到文本框"1"

按添加按钮
输入到文本框"2"

按添加按钮
输入到文本框"3"

按添加按钮
输入到文本框"4"

直到这里一切都很好.

然后向上滚动数据转发器,"1"消失.
有人知道为什么会这样吗?我该如何预防?感谢您的任何建议.

最好的问候


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

推荐答案

首先,将控件名称保留为默认名称(Button1)是一个糟糕的主意.我不知道这是否是添加"按钮代码.

接下来,您是否将文本框的内容添加到某处的数据存储中?您没有在发布的代码中执行此操作,因此无法分辨.
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.


这篇关于文本消失在DataRepeater的TextBox上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆