以文本方式查看主题

-  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=110233)

--  作者:有点甜
--  发布时间:2017/11/29 15:06:00
--  

参考

 

Tables("表A").grid.AllowFiltering = true


--  作者:有点甜
--  发布时间:2017/11/29 15:45:00
--  

1、你这样做的目的是什么?

 

2、为什么一定要在列标题下拉,隐藏列标题,在表格里面下拉更好控制。


--  作者:有点甜
--  发布时间:2017/11/29 16:25:00
--  

参考

 

http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=109607&skin=0

 


--  作者:有点甜
--  发布时间:2017/11/29 22:01:00
--  
以下是引用ZJZK2015在2017/11/29 21:46:00的发言:
老师你好:

在foxtable中table的列名是否可以采用下拉框??

 

可以,做起来比较麻烦。参考 http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=100787&skin=0

 

你可以把列名隐藏,把第一行当成列名不就好了?


--  作者:有点甜
--  发布时间:2017/11/29 22:44:00
--  

参考

 

http://www.foxtable.com/webhelp/scr/2334.htm

 

 


--  作者:有点甜
--  发布时间:2017/12/1 9:09:00
--  

prepareEdit事件

 

If e.Row.Index = 0 Then
    Dim nm As String = ""
    For Each dc As Col In Tables("表A").Cols
        nm = nm & "|" & dc.Name
    Next
    e.Col.ComboList = nm
Else
    e.Col.ComboList = Nothing
End If


--  作者:有点蓝
--  发布时间:2017/12/4 14:13:00
--  
截图说明一下实际的表格和数据模式
--  作者:有点甜
--  发布时间:2017/12/4 14:39:00
--  
Dim tb As Table = Tables("窗口1_table1")
For Each r As Row In tb.Rows
    For Each cl As Col In tb.Cols
        If cl.Visible = True Then
            Dim s As String = tb.Rows(0)(cl.Name)
            If r("行类别") <> Nothing AndAlso DataTables("合同清单").datacols.contains(s) Then
                Dim dr2 As DataRow = DataTables("合同清单").AddNew()
                dr2(s) = r(s)
            End If
        End If
    Next
Next

--  作者:有点蓝
--  发布时间:2017/12/5 8:50:00
--  
展示给用户看的可以使用标题。在代码中处理应该使用列名而不是列标题。代码用户又看不到,何必自己为难自己呢
--  作者:有点甜
--  发布时间:2017/12/5 9:20:00
--  

循环每一列,把标题和列名对应起来。再有就是,你datacol的标题有可能是空值,要注意,必须用table

 

Dim dt As Table = Tables("表a")
Dim dic As new Dictionary(of String, Col)
For Each dc As Col In dt.Cols
    If dic.ContainsKey(dc.Caption) = False Then
        dic.Add(dc.Caption, dc)
    End If
Next
msgbox(dic("第一列").name)