UpdatePanel 中的 GridView 在对另一个网格进行排序时添加额外的行

发布于 2024-08-26 09:09:54 字数 309 浏览 4 评论 0原文

我看到了一些我以前从未见过的奇怪行为。

我在单独的 UpdatePanel 中有两个网格。我可以毫无问题地对每个内容进行分页和排序。

每个网格每页设置 10 个。

如果第一个网格(13 条记录)被分页到第二页,然后我转到第二个网格(14 条记录)并分页到下一页,第一个网格向网格添加一堆空行,因此它已满显示 10。行中没有数据...只有空行。每个网格都在分页和排序上执行此操作。

我已经单步执行了代码,但其他网格的加载从未发生,因此它告诉我的 AJAX 正在执行某些操作以将“幻像”行添加到网格中。

有什么想法或调试方法吗?

I'm a seeing some weird behavior that i have never seen before.

I have two grid in separate UpdatePanels. I can page and sort each without any problems.

Each grid is set for 10 per page.

If the first grid (13 records) is paged to the second page and then i go down to the second grid (14 records) and page to the next page and the first grid adds a bunch of empty rows to the grid so it is full to show 10. There is no data in the rows...just empty rows. Each grid does this on paging and sorting.

Ive stepped through the code and the the loading of the other grids never happens so it tells my AJAX is doing something to add the 'phantom' rows to the grid.

Any ideas why or ways to debug this?

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

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

发布评论

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

评论(1

灯下孤影 2024-09-02 09:09:54

我不知道你是否解决了这个问题。我在涉及模板字段中的复选框的网格视图中遇到了类似的问题。每当我单击小于定义页面大小的页面上的复选框时,gridview 都会使用页面大小定义的行数重新绘制自身。因此,在最后一行有效数据之后,我最终会得到几个空行。

我通过禁用 gridview 上的视图状态(即 EnableViewState="false")解决了这个问题,一切都很顺利。

I don't know whether you got a fix for this or not. I had a similar problem with a gridview involving a checkbox in a templatefield. Whenever I clicked the checkbox on a page with less than the defined page size, the gridview would redraw itself with as many rows as was defined by the page size. So I'd end up with several empty rows after the last row of valid data.

I solved this problem by disabling the viewstate on the gridview (i.e. EnableViewState="false") and everything worked out fine.

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