RadGrid 不会在页面 1 上显示过滤数据

发布于 2024-08-29 09:52:01 字数 226 浏览 3 评论 0原文

我有一个绑定到 Linq 数据源的 Telerik RadGrid。在初始页面加载时,数据在 RadGrid 中显示良好。如果我留在第一页并过滤数据,它会正确显示。但是,如果我转到第 2 页或第 3 页或除第 1 页之外的任何页面并过滤数据,它不会显示在 RadGrid 中。我检查了 linq 在立即窗口中生成的 sql,它正在生成正确的 sql 并返回结果,但当我分页到除第一个页面之外的任何页面时,它不会显示在 radgrid 中。

I have a Telerik RadGrid that is bound to a Linq Datasource. On the intial page load, the data shows up fine in the RadGrid. If I remain on Page 1 and filter the data, it shows correctly. However, if I go to page 2 or 3 or any page but the first 1 and filter the data, it does not display in the RadGrid. I examined the sql that linq is generating in the immediate window and it is generating the proper sql and bringing back results, but it is not displaying in the radgrid when I page to any page but the first.

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

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

发布评论

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

评论(1

牵你手 2024-09-05 09:52:01

RadGrid 过滤器表达式存在问题。

您需要通过将表达式存储在 ViewState 中(可能是 LinqDataSource 的 OnSelect 事件)来重置 FilterExpression,然后在页面的 PreRender 事件中,您需要从存储的 ViewState 恢复 FilterExpression。

希望这有帮助。

您可以参考此链接http://www.telerik.com/community/forums/aspnet-ajax/grid/maximum-rows-parameter-with-filtering.aspx

There is a problem with RadGrid filter expression.

You need to reset the FilterExpression by storing the expression in the ViewState(may be OnSelect event of the LinqDataSource) and then on PreRender event of the page you need to restore the FilterExpression from the stored ViewState.

Hope this helps.

You can refer this link http://www.telerik.com/community/forums/aspnet-ajax/grid/maximum-rows-parameter-with-filtering.aspx

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