【发布时间】:2009-06-17 16:01:34
【问题描述】:
我有一个数据网格,我在其中使用 Subsonic 框架中的自定义分页选项(参考:http://subsonicproject.com/querying/webcast-using-paging/)。
我还有一个按州过滤数据的下拉菜单。这是通过 addwhere 调用添加到查询中的。
数据按州 ASC 排序,然后按城市 ASC 排序。
当没有选择任何状态时,数据似乎是有序的,因此没有将 addwhere 添加到子句中。但是,如果您选择的状态有足够的记录导致分页启动,那么某些记录会乱序显示。我还注意到,当前页面上的最后几条记录似乎总是显示在网格中间的某个位置。
sn-p 到 loadgrid 的代码:
Dim qry As New SubSonic.Query( {myTableSchema} )
If ddlStates.SelectedValue.Trim.ToLower <> "all states" Then
qry.AddWhere("state", ddlStates.SelectedValue.Trim)
End If
qry.ORDER_BY("state", "ASC").ORDER_BY("city", "ASC")
qry.PageSize = ddlDisplay.SelectedValue
qry.PageIndex = pageNumber
gvOrganizers.DataSource = qry.ExecuteDataSet
gvOrganizers.DataBind()
The problem doesn't seem to appear when a state is selected and there is only 1 page of data.默认 ddlDisplay 设置为每页 100 条记录,但即使选择 50 或 25 也会出现错误。
使用亚音速 2.1.0.0
【问题讨论】:
标签: sorting subsonic custompaging