未绑定数据中继器滚动问题

发布于 2024-09-28 22:23:37 字数 600 浏览 2 评论 0原文

  1. 我将一个 DataRepeater 拖入我的表单中。

  2. 向 DataRepeaterItem 添加了一个文本框。

  3. 向表单添加了一个按钮。

  4. 写了这两行代码:

    私有子 Button1_Click(..) 处理 Button1.Click DataRepeater1.VirtualMode = True DataRepeater1.AddNew() End Sub

  5. 运行项目

  6. 按添加按钮

  7. 在文本框中写入“1”

  8. 按添加按钮

  9. 在文本框中写入“2”

  10. 按添加按钮

  11. 在文本框中 写“3”

  12. 写“3”

    按添加按钮

  13. 在文本框中

写“4”直到这里一切都很好。

然后滚动数据重复器向上

“1”更改为默认 TextBox1

为什么会发生这种情况。我怎样才能防止它发生。

提前致谢。

  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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清浅ˋ旧时光 2024-10-05 22:23:37

转发器控件本身不会保存所有值。在虚拟模式下,您不必使用数据源,但必须使用某些东西。在此示例中,他们使用了一个简单的整数数组: VB.NET Repeater Simple没有数据源的数据绑定

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文