以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [求助]选定问题 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=79202) |
||||
-- 作者:blsu33 -- 发布时间:2015/12/26 9:59:00 -- [求助]选定问题 老师, DropDownOpening 代码如下 Dim lvw As WinForm.ListView = e.Form.Controls("ListView3") Dim ss As String = e.Form.DropDownBox.Value If ss > "" Then Dim ary() As String = e.Form.DropDownBox.BindingField.Split(".") Dim dr As DataRow = DataTables("Z005窗表字段设置").Find("[绑定表] =\'"& ary(0) &"\' And [绑定列] =\'"& ary(1) &"\' and [绑定窗口名称]=\'通用目录树\'") If dr IsNot Nothing AndAlso dr.IsNull("绑定赋值列")=False AndAlso dr.IsNull("取值列")=False Then \'如果在项目表找到对应的行 Dim vals() As String = e.Form.DropDownBox.Value.split(",") Dim Parts1() As String=dr("取值显示列").Split(",") Dim i1 As Integer For Each r As WinForm.ListViewRow In lvw.Rows For i1=0 To Parts1.Length-1 If array.IndexOf(vals, r(Parts1(i1))) >= 0 Then r.Checked = True MessageBox.Show(r(Parts1(i1)) & r.Checked) Else r.Checked = False End If Next Next Else For Each r As WinForm.ListViewRow In lvw.Rows r.Checked = False Next
End If End If 弹窗显示了已经为TRUE,为何复选框还不选定呢 |
||||
-- 作者:Hyphen -- 发布时间:2015/12/26 10:30:00 -- 代码没有问题,上传例子测试 |
||||
-- 作者:blsu33 -- 发布时间:2015/12/27 8:36:00 -- 老师, 麻烦您给看看,窗口1
|
||||
-- 作者:blsu33 -- 发布时间:2015/12/27 12:09:00 -- 红袍老师, 下拉不知道问什么出问题,麻烦您给看看啊。
|
||||
-- 作者:大红袍 -- 发布时间:2015/12/27 12:20:00 -- \'下拉复选框 Dim lvw As WinForm.ListView = e.Form.Controls("ListView3") Dim ss As String = e.Form.DropDownBox.text For Each r As WinForm.ListViewRow In lvw.Rows r.Checked = False Next If ss > "" Then Dim ary() As String = e.Form.DropDownBox.BindingField.Split(".") Dim dr As DataRow = DataTables("Z005窗表字段设置").Find("[绑定表] =\'"& ary(0) &"\' And [绑定列] =\'"& ary(1) &"\' and [绑定窗口名称]=\'通用目录树\'") If dr IsNot Nothing AndAlso dr.IsNull("绑定赋值列")=False AndAlso dr.IsNull("取值列")=False Then \'如果在项目表找到对应的行 Dim vals() As String =ss.split(",") Dim Parts1() As String=dr("取值显示列").Split(",") Dim i1 As Integer For Each r As WinForm.ListViewRow In lvw.Rows For i1=0 To Parts1.Length-1 If array.IndexOf(vals, r(Parts1(i1))) >= 0 Then r.Checked = True Exit For End If Next Next End If End If |
||||
-- 作者:blsu33 -- 发布时间:2015/12/27 12:33:00 -- 怎么又是这个问题 谢谢老师了 |
||||
-- 作者:blsu33 -- 发布时间:2015/12/28 10:32:00 -- 老师, listview的 确定按钮复选的确定按钮。 Dim lvw As WinForm.ListView = e.Form.Controls("ListView3") Dim vls As String = "" Dim ary() As String = e.Form.DropDownBox.BindingField.Split(".") Dim tr As Row = Tables(ary(0)).Current Dim dr As DataRow = DataTables("Z005窗表字段设置").Find("[绑定表] =\'"& ary(0) &"\' And [绑定列] =\'"& ary(1) &"\' AND [绑定窗口名称]=\'通用目录树\'") If dr IsNot Nothing AndAlso dr.IsNull("绑定赋值列")=False AndAlso dr.IsNull("取值列")=False Then \'如果在项目表找到对应的行 For Each vr As WinForm.ListViewRow In lvw.CheckedRows vls = vls & "," & vr.Text Next e.Form.DropDownBox.Value = vls.Trim(",") Dim dr1 As DataRow = lvw.Current.tag 这后面就不会写了,请老师指点 Dim vals() As String = e.Form.DropDownBox.Value.split(",") Dim Parts2() As String=dr("取值显示列").Split(",") Dim i1 As Integer For Each r As WinForm.ListViewRow In lvw.Rows For i1=0 To Parts2.Length-1 tr(Parts2(i1))=dr1(Parts2(i1)) MessageBox.Show(tr(Parts2(i1))) MessageBox.Show(dr1(Parts2(i1))) Next Next End If e.Form.DropDownBox.CloseDropdown() |
||||
-- 作者:blsu33 -- 发布时间:2015/12/28 10:34:00 -- 希望达到的效果是这样的, 第一列 第二列 第三例 94,01 测试,看看 张三,李四
|
||||
-- 作者:大红袍 -- 发布时间:2015/12/28 10:58:00 -- Dim lvw As WinForm.ListView = e.Form.Controls("ListView3")
|