以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]窗口中SQLQuery表设置了分页加载能否通过复选框取消分页  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=94997)

--  作者:ajie5211
--  发布时间:2017/1/7 13:28:00
--  [求助]窗口中SQLQuery表设置了分页加载能否通过复选框取消分页
如题,窗口中SQLQuery表设置了分页加载能否通过复选框取消分页?我在复选框CheckedChanged事件中重写了加载条件,但没反应。

图片点击可在新窗口打开查看此主题相关图片如下:qq截图20170107132630.png
图片点击可在新窗口打开查看

图片点击可在新窗口打开查看此主题相关图片如下:qq截图20170107132616.png
图片点击可在新窗口打开查看

--  作者:有点蓝
--  发布时间:2017/1/7 13:32:00
--  
怎么分页的?代码?CheckedChanged事件代码上传看看
--  作者:ajie5211
--  发布时间:2017/1/7 13:37:00
--  
窗口打开加载时的分页代码如下:
Dim yz As WinForm.TextBox = e.Form.Controls("页")
With DataTables(e.Form.Name & "_Table1")
    .LoadFilter = "F4169 <> \'盘点平账入库\' and F4169 <> \'盘点平账出库\'" \'一定要清除加载条件
    .LoadTop = 5
    .LoadPage = 0
    .LoadOver = "ID"
    .LoadReverse = True
    .Load()
    yz.Value = 1 & "/" & .TotalPages
End With
取消分页中时CheckedChanged事件代码如下:
Dim Filter As String
With e.Form.Controls("s产品料号")
    If .Value IsNot Nothing Then
        Filter = "F177 like \'%" & .Value & "%\'"
    End If
End With
With e.Form.Controls("s名称")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "F178 like \'%" & .Value & "%\'"
    End If
End With
If filter > "" Then
    Dim cmd As New SQLCommand
    Dim dt As DataTable
    cmd.C
    cmd.CommandText = "SELECT * Fro m {tabDIYTable31} where " & filter
    dt = cmd.ExecuteReader()
    filter = ""
    If dt.DataRows.Count = 1 Then
        filter = "ID = " & dt.DataRows(0)("ID")
    Else If dt.DataRows.Count > 1 Then
        filter = "ID in (" & dt.DataRows(0)("ID")
        For i As Integer = 1 To dt.DataRows.Count - 1
            filter = filter & "," & dt.DataRows(i)("ID")
        Next
        filter = filter & ")"
    End If
End If
With e.Form.Controls("s单号")
    If .Value IsNot Nothing Then
        If Filter > "" Then
            Filter = Filter & " And "
        End If
        Filter = Filter & "F172 like \'%" & .Value & "%\'"
    End If
End With
If filter > "" Then
    filter = filter & "and F4169 <> \'盘点平账入库\' and F4169 <> \'盘点平账出库\'"
Else
    filter = "F4169 <> \'盘点平账入库\' and F4169 <> \'盘点平账出库\'"
End If
Dim yz As WinForm.TextBox = e.Form.Controls("页")
If e.Sender.Checked = False Then
    With DataTables(e.Form.Name & "_Table1")
        .LoadFilter = filter  \'一定要清除加载条件
        .LoadTop = 5
        .LoadPage = 0
        .LoadOver = "ID"
        .LoadReverse = True
        .Load()
        yz.Value = 1 & "/" & .TotalPages
    End With
Else
    DataTables(e.Form.Name & "_Table1").LoadFilter = filter \'一定要清除加载条件
    DataTables(e.Form.Name & "_Table1").FillLoadTime.Out = 100
    DataTables(e.Form.Name & "_Table1").Load
    yz.Value = 1
End If
With Tables(e.Form.Name & "_Table1")
    .ExtendLastCol = True
    .AutoSizeRows()
    If .Rows.Count > 0 Then
        .Select(0,0)
    End If
End With
Tables("入库单").ExtendLastCol = True
Tables("入库单").AutoSizeRows()

--  作者:有点蓝
--  发布时间:2017/1/7 15:13:00
--  
......
Else
    DataTables(e.Form.Name & "_Table1").LoadFilter = filter \'一定要清除加载条件
    DataTables(e.Form.Name & "_Table1").LoadTop = "100 Percent"
    DataTables(e.Form.Name & "_Table1").FillLoadTime..Out = 100
    DataTables(e.Form.Name & "_Table1").Load
    yz.Value = 1
End If

--  作者:ajie5211
--  发布时间:2017/1/7 15:22:00
--  
以下是引用有点蓝在2017/1/7 15:13:00的发言:
......
Else
    DataTables(e.Form.Name & "_Table1").LoadFilter = filter \'一定要清除加载条件
    DataTables(e.Form.Name & "_Table1").LoadTop = "100 Percent"
    DataTables(e.Form.Name & "_Table1").FillLoadTime...Out = 100
    DataTables(e.Form.Name & "_Table1").Load
    yz.Value = 1
End If
谢谢,可以了。