以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]列授权 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=111262) |
-- 作者:江南小镇 -- 发布时间:2017/12/18 22:21:00 -- [求助]列授权 老师,我想在列名列的行里同时勾选多列进行授权,下面的代码只能一行授权一列。 For Each t As Table In Tables \'显示所有表和列
|
-- 作者:有点蓝 -- 发布时间:2017/12/18 22:34:00 -- For Each dr As DataRow In DataTables("授权表").Select("(\',\' + Name + \',\' like \'%," & User.Name & ",%\' or \',\' + Config + \',\' like \'%," & User.group & ",%\')") If dr.IsNull("列名") Then For Each t As Table In Tables If t.DataTable.Name = dr("表名") Then t.Visible = Not dr("不可见") t.AllowEdit = Not dr("不可编辑") End If Next Else For Each t As Table In Tables If t.DataTable.Name = dr("表名") Then Dim cls() As String = dr("列名").split(",") For Each c As String In cls If t.Cols.Contains(c) Then t.Cols(c).Visible = Not dr("不可见") t.Cols(c).AllowEdit = Not dr("不可编辑") End If Next End If Next End If Next
|
-- 作者:江南小镇 -- 发布时间:2017/12/19 20:45:00 -- 谢谢老师 |
-- 作者:new4w -- 发布时间:2018/4/17 10:10:00 -- 上面代码是放到项目事件LoadUserSetting中,如果列视图里面有跟可见性相矛盾的,以哪个为准? |
-- 作者:有点甜 -- 发布时间:2018/4/17 10:12:00 -- 以下是引用new4w在2018/4/17 10:10:00的发言:
上面代码是放到项目事件LoadUserSetting中,如果列视图里面有跟可见性相矛盾的,以哪个为准?
看谁先执行。如果先执行隐藏,再执行显示,列自然是显示的。反之,就是隐藏的。 |