以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]请问记录窗口如何跟table1联动? (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=143408) |
||||
-- 作者:TnT107 -- 发布时间:2019/11/23 14:46:00 -- [求助]请问记录窗口如何跟table1联动? 请问记录窗口如何跟table1联动?
|
||||
-- 作者:zoyong -- 发布时间:2019/11/23 14:50:00 -- Dim rgd As WinForm.RecordGrid = e.Form.Controls("RecordGrid1") rgd.Table = Tables(e.Form.name & "_Table1") \'绑定表 rgd.Columns = “要显示的列” rgd.Build() [此贴子已经被作者于2019/11/23 14:50:38编辑过]
|
||||
-- 作者:TnT107 -- 发布时间:2019/11/23 15:06:00 -- 谢谢 !! 请问我Table1 的select 语句要改成动态与combobox表控件关联要如何改, 谢谢. [此贴子已经被作者于2019/11/23 15:05:51编辑过]
|
||||
-- 作者:有点蓝 -- 发布时间:2019/11/23 15:20:00 -- 我这边打不开项目文件,压缩一下重新发上来。 要做什么功能?把代码发上来看看
|
||||
-- 作者:TnT107 -- 发布时间:2019/11/23 15:29:00 --
|
||||
-- 作者:有点蓝 -- 发布时间:2019/11/23 15:37:00 -- 我这边还是打不开,压缩一下项目:http://www.foxtable.com/webhelp/topics/0006.htm 或者直接贴出代码说明
|
||||
-- 作者:TnT107 -- 发布时间:2019/11/23 15:44:00 --
|
||||
-- 作者:TnT107 -- 发布时间:2019/11/23 15:47:00 -- 此主题相关图片如下:q2.jpg |
||||
-- 作者:有点蓝 -- 发布时间:2019/11/23 15:47:00 -- 还是打不开。直接贴出代码说明吧 |
||||
-- 作者:TnT107 -- 发布时间:2019/11/23 15:51:00 -- 窗口表事件 窗口与控件事件 窗口1_AfterLoad e.Form.BaseForm.WindowState = System.Windows.Forms.FormWindowState.Maximized \'e.Form.Controls("TabControl1").BaseControl.BackColor = Color.FromARGB(216,233,255) \'查詢的欄位儲存值顯示 If GetConfigValue("目录树表列","") > "" Then e.Form.Controls("ComboBox表").Text = GetConfigValue("目录树表列","").Split("#")(0) e.Form.Controls("CheckedComboBox列").Text = GetConfigValue("目录树表列","").Split("#")(1).Replace("|",",") e.Form.Controls("TreeView1").BuildTree(GetConfigValue("目录树表列","").Split("#")(0) ,GetConfigValue("目录树表列","").Split("#")(1)) e.Form.Controls("TreeView1").Nodes.Insert("显示所有行",0) End If Dim rgd As WinForm.RecordGrid = e.Form.Controls("RecordGrid1") rgd.Table = Tables(e.Form.name & "_Table1") \'绑定表 \'rgd.Columns = "要显示的列" rgd.Build() 窗口1_CheckedComboBox列_Enter If DataTables.Contains(e.Form.Controls("ComboBox表").Text) = False Then Return End If \'e.Sender.ComboList = "" \'e.Sender.Text = "" Dim s As String For Each dc As DataCol In DataTables(e.Form.Controls("ComboBox表").Text).DataCols s + = dc.Name & "|" Next e.Sender.ComboList = s.Trim("|") 窗口1_CheckedComboBox列_TextChanged If DataTables.Contains(e.Form.Controls("ComboBox表").Text) = False Then Return End If e.Form.Controls("TreeView1").BuildTree(e.Form.Controls("ComboBox表").Text,e.Sender.Text.Replace(",","|")) e.Form.Controls("TreeView1").Nodes.Insert("显示所有行",0) \'\'\'\'\'\'儲存查詢條件 SaveConfigValue("目录树表列",e.Form.Controls("ComboBox表").Text & "#" & e.Sender.Text.Replace(",","|")) 窗口1_ComboBox表_Enter e.Sender.ComboList = "" e.Sender.Text = "" Dim s As String For Each dt As DataTable In DataTables If dt.Type = 1 OrElse dt.Type = 3 Then s + = dt.Name & "|" End If Next e.Sender.ComboList = s.Trim("|") \'Dim pg As WinForm.TabControl = e.Form.Controls("TabControl1") 窗口1_ComboBox表_TextChanged e.Form.Controls("CheckedComboBox列").Text = "" If DataTables.Contains(e.Sender.Text) Then Tables(e.Form.Name & "_Table1").DataSource = DataTables(e.Sender.Text) End If 窗口1_TreeView1_NodeMouseClick Dim Values() As String = e.Form.Controls("CheckedComboBox列").Text.Split(",") Dim strs() As String = e.Node.FullName.Split("\\") Dim dr As DataRow = e.Node.DataRow Dim flt As String If e.Node.Name = "显示所有行" Then flt = "" Else For i As Integer = 0 To strs.Length - 1 \'\'间接获取目录树层级(Level) For j As Integer = 0 To Values.Length - 1 If i = j Then \'\'只加入选定节点及以上的节点 flt + = Values(j) & "= \'" & dr(Values(j)) & "\' And " End If Next Next End If If flt = "" Then Tables(e.Form.Name & "_Table1").Filter = "" Else Tables(e.Form.Name & "_Table1").Filter = flt.SubString(0,flt.Length - 5) End If [此贴子已经被作者于2019/11/23 15:54:20编辑过]
|