以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]行列批量显示隐藏操作  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=134056)

--  作者:湛江智
--  发布时间:2019/4/26 10:43:00
--  [求助]行列批量显示隐藏操作
 1、下面是批量删除选择行的代码怎样修改成,批量隐藏行呢?  同时反向全部取消隐藏行,代码怎样呢?
With Tables("表A")
    For i As Integer = .BottomPosition To .TopPosition Step -1
        .Rows(i).Delete()
    Next
End With

Remove,会不会删除数据?
With Tables("表A")
    For i As Integer = .BottomPosition To .TopPosition Step -1
        .Rows(i).Remove()
    Next
End With

反向全部取消隐藏行,下面代码无效,怎么修改呢?
Dim t As Table = Tables("表A")
t.HideSelectedRows
\'msgbox(t.filter)
t.filter = ""

2、空值列批量隐藏:
For Each c As Col In Tables("表A").Cols
    Dim fdr As DataRow = c.Table.DataTable.Find(c.name & " is not null")
    If fdr IsNot Nothing Then
        c.Visible = True
    Else
        c.Visible = False
    End If
Next

求助:取消窗口表中空值列的隐藏 ,下面代码无效,怎么修改?
\'窗口表中空值列的隐藏
With Tables("表A")
    For Each c1 As Col In .Cols
        c1.Visible = True
    Next
    For Each c2 As Col In .Cols
        Dim p As Integer = .FindRow(c2.Name & " Is Not Null")
        If P = -1 Then
            c2.Visible = False
        End If
    Next
End With
[此贴子已经被作者于2019/4/26 11:14:03编辑过]

--  作者:有点蓝
--  发布时间:2019/4/26 11:15:00
--  
隐藏:

With Tables("表A")
    For i As Integer = .BottomPosition To .TopPosition Step -1
        .grid.Rows(i+1).visible = False
    Next
End With

显示
Tables("表A").filter = ""

取消窗口表中空值列的隐藏
With Tables("表A")
    For Each c1 As Col In .Cols
        c1.Visible = True
    Next



--  作者:湛江智
--  发布时间:2019/4/28 20:08:00
--  回复:(有点蓝)隐藏:With Tables("表A")  &nb...
 坛主,          下面代码要实现,在当前窗口的副本表显示列中,隐藏空值列,下面代码怎么修改?
不是整个表的所有列去判断,只是在当前窗口的副本表显示列中,隐藏空值列

隐藏空值列
For Each c As Col In Tables("全周期计划后台窗口_Table1").Cols
    Dim fdr As DataRow = c.Table.DataTable.Find(c.name & " is not null")
    If fdr IsNot Nothing Then
        c.Visible = True
    Else
        c.Visible = False
    End If
Next



--  作者:有点甜
--  发布时间:2019/4/29 11:26:00
--  

你需要用一个变量,在afterLoad事件记录你显示列的值,如

 

vars("显示列") = "第一列|第三列|第四列"