如何在For循环内绑定gridView而不覆盖以前的绑定?

发布于 2024-10-01 17:24:30 字数 140 浏览 0 评论 0原文

我在执行多次的 for 循环内绑定了一个网格视图。现在,当循环结束时,网格视图中的数据是最后一次运行 For 循环时绑定的数据,即 For 循环中的所有先前绑定都被覆盖。不想要这个。我希望在每次运行 for 循环时插入新行。请帮助某人。我不知道该怎么做。 提前致谢。

I'm binding a Grid View inside a for loop which executes more than once.Now when the loop ends the Data in grid view is the data binded at the last run of For loop i.e all Previous Binds in the For loop over overwritten.I dont want this .I want new rows to be Inserted at each run of the for Loop ..Plz help somebody. I dont get how to do this.
Thanx in advance.

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

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

发布评论

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

评论(1

两人的回忆 2024-10-08 17:24:30

不要在循环中进行数据绑定。首先对数据进行排序,然后将其分配给 GridView 的 DataSource,然后调用 Databind。

Don't databind in a loop. Get your data sorted first, then assign it to the GridView's DataSource, then call Databind.

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