Foxtable(狐表)用户栏目专家坐堂 → [求助]字典很卡求助


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

主题:[求助]字典很卡求助

帅哥,在线噢!
有点蓝
  11楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106260 积分:540429 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/1/21 13:44:00 [显示全部帖子]


If e.Sender.Gettype.name = "ComboBox" AndAlso e.Sender.BindingField > "" Then
    
    Dim ary() As String = e.Sender.BindingField.Split(".")
    Dim r As Row = Tables(ary(0)).Current
    If r IsNot Nothing Then
        Dim filter As String = "表名 = '" & ary(0) & "' and 列名 = '" & ary(1) & "' and 下拉选项 Is not null and 停用=false  and ','+条件值+',' like '%," & r("列项条件列") & ",%'"
        Dim fdr As DataRow = DataTables("列项设置").Find(filter)
        If fdr Is Nothing
            DataTables("列项设置").Find("表名='" & ary(0) & "' and 列名='" & ary(1) & "' and 下拉选项 Is not null and 停用=false and 条件值='其他'")
        End If
        If fdr IsNot Nothing
            e.sender.ComboList = fdr("下拉选项")
            e.Sender.AllowEditValue = fdr("允许编辑")
        End If
        
        If fdr Is Nothing
            If dr("多值字段")=True Then
                DataTables(e.Table.name).DataCols(c.name).ExtendType = ExtendTypeEnum.Values
            ElseIf dr("多值字段")=False Then
                DataTables(e.Table.name).DataCols(c.name).ExtendType = ExtendTypeEnum.none
            End If
            e.sender.AllowDirectType=dr("允许编辑")
            e.sender.ComboList = =dr("下拉选项")
        Else
            e.sender.combolist=""
        End If
    End If
End If


 回到顶部
帅哥,在线噢!
有点蓝
  12楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106260 积分:540429 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/1/21 15:14:00 [显示全部帖子]

这段代码去掉

If dr("多值字段")=True Then
    DataTables(e.Table.name).DataCols(c.name).ExtendType = ExtendTypeEnum.Values
ElseIf dr("多值字段")=False Then
    DataTables(e.Table.name).DataCols(c.name).ExtendType = ExtendTypeEnum.none
End If

 回到顶部
帅哥,在线噢!
有点蓝
  13楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106260 积分:540429 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/1/21 15:25:00 [显示全部帖子]

改为AllowEditValue 

e.Sender.AllowEditValue = fdr("允许编辑")

 回到顶部
帅哥,在线噢!
有点蓝
  14楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106260 积分:540429 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/1/21 16:18:00 [显示全部帖子]

e.Sender.AllowEditValue = dr("允许编辑")

 回到顶部
帅哥,在线噢!
有点蓝
  15楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106260 积分:540429 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/4/14 22:22:00 [显示全部帖子]

没看懂。都没有选项,下拉什么?

 回到顶部
帅哥,在线噢!
有点蓝
  16楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106260 积分:540429 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/4/15 10:21:00 [显示全部帖子]

没有条件值时,下拉选项值为所有数据?判断一下条件如果是空的,直接取所有下拉选项数据不就行了

 回到顶部
帅哥,在线噢!
有点蓝
  17楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106260 积分:540429 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/4/15 11:14:00 [显示全部帖子]

试试

If e.Sender.Gettype.name = "ComboBox" AndAlso e.Sender.BindingField > "" Then
    
    Dim ary() As String = e.Sender.BindingField.Split(".")
    Dim r As Row = Tables(ary(0)).Current
    If r IsNot Nothing Then
        Dim dr As DataRow
        If  r.IsNull("列项条件列") = False
            Dim filter As String = "表名 = '" & ary(0) & "' and 列名 = '" & ary(1) & "' and 下拉选项 Is not null and 停用=false  and ','+条件值+',' like '%," & r("列项条件列") & ",%'"
            Dim fdr As DataRow = DataTables("列项设置").Find(filter)
            
            If fdr IsNot Nothing Then
                e.sender.ComboList = fdr("下拉选项")
                e.Sender.AllowEditValue = fdr("允许编辑")
            Else
                dr = DataTables("列项设置").Find("表名='" & ary(0) & "' and 列名='" & ary(1) & "' and 下拉选项 Is not null and 停用=false and 条件值='其他'")
                If dr IsNot Nothing Then
                    e.Sender.AllowEditValue = dr("允许编辑")
                    e.sender.ComboList = dr("下拉选项")
                Else
                    e.sender.combolist= " "
                End If
            End If
        Else
            Dim d As String = DataTables("列项设置").GetComboListString("下拉选项","表名='" & ary(0) & "' and 列名='" & ary(1) & "' and 下拉选项 Is not null and 停用=false")
            If d > "" Then
                e.Sender.AllowEditValue = dr("允许编辑")
                e.sender.ComboList = d
            Else
                e.sender.combolist= " "
            End If
        End If
    End If
End If

 回到顶部
帅哥,在线噢!
有点蓝
  18楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106260 积分:540429 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/4/15 14:11:00 [显示全部帖子]

什么错误!!!!!!!!!!!!!!!!

 回到顶部
帅哥,在线噢!
有点蓝
  19楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:106260 积分:540429 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2020/4/15 15:32:00 [显示全部帖子]

……
        Else
            Dim d As String = DataTables("列项设置").GetComboListString("下拉选项","表名='" & ary(0) & "' and 列名='" & ary(1) & "' and 下拉选项 Is not null and 停用=false")
            If d > "" Then
                e.Sender.AllowEditValue = false
                e.sender.ComboList = d
            Else
                e.sender.combolist= " "
            End If
        End If
    End If
End If

 回到顶部
总数 20 上一页 1 2