Foxtable(狐表)用户栏目专家坐堂 → [求助]选定问题


  共有2309人关注过本帖树形打印复制链接

主题:[求助]选定问题

帅哥哟,离线,有人找我吗?
大红袍
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By: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

 回到顶部
帅哥哟,离线,有人找我吗?
大红袍
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2015/12/28 10:58:00 [显示全部帖子]

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 '如果在项目表找到对应的行
    Dim Parts1() As String=dr("取值列").Split(",")
    Dim Parts2() As String=dr("绑定赋值列").Split(",")
    Dim vals(Parts1.length-1)
    For Each vr As WinForm.ListViewRow In lvw.CheckedRows
        Dim fdr As DataRow = DataTables(dr("取值表")).find("_Identify = " & vr.Name)
        If fdr IsNot Nothing
            For i As Integer = 0 To parts1.length-1
                vals(i) &= fdr(parts1(i)) & ","
            Next
        End If
        vls = vls & "," & vr.Text
    Next
    For i As Integer = 0 To parts2.length-1
        tr(parts2(i)) = vals(i).Trim(",")
    Next
    e.Form.DropDownBox.Value = vls.Trim(",")
End If


e.Form.DropDownBox.CloseDropdown()


 回到顶部