Foxtable(狐表)用户栏目专家坐堂 → 记录窗口锁定列的背景色设置


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

主题:记录窗口锁定列的背景色设置

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


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

Dim rgd As WinForm.RecordGrid = e.Form.Controls("RecordGrid1")
Dim t As Table = rgd.Table
Dim g As object  = rgd.basecontrol
Dim cs1 As C1.Win.C1FlexGrid.CellStyle = g.Styles.Add("样式1")
cs1.backcolor = Color.Gray
For Each r As object In g.rows
    If t.cols(r(0)).AllowEdit = False Then
        g.SetCellStyle(r.index, 1, cs1)
    End If
Next

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


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

改一下

 

Dim rgd As WinForm.RecordGrid = e.Form.Controls("RecordGrid1")
Dim t As Table = rgd.Table
Dim g As object  = rgd.basecontrol
Dim cs1 As C1.Win.C1FlexGrid.CellStyle = g.Styles.Add("样式1")
cs1.backcolor = Color.Gray
For Each r As object In g.rows
    For Each c As Col In t.cols
        If c.name = r(0) Then
            If c.AllowEdit = False Then
                g.SetCellStyle(r.index, 1, cs1)
            End If
            Exit For
        End If
    Next
Next


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


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

If c.name = r(0) Then

改成

 

If c.Caption= r(0) Then


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


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

Dim rgd As WinForm.RecordGrid = e.Form.Controls("RecordGrid1")
Dim t As Table = rgd.Table
Dim g As object  = rgd.basecontrol
For Each r As object In g.rows
    For Each c As Col In t.cols
        If c.caption = r(0) Then
            If c.AllowEdit = False Then
                Dim cs1 As C1.Win.C1FlexGrid.CellStyle = g.GetCellRange(r.index, 1).style
                cs1.backcolor = Color.Gray
            End If
            Exit For
        End If
    Next
Next

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


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

Dim cs1 As C1.Win.C1FlexGrid.CellStyle = g.GetCellRange(r.index, 1).style
cs1.backcolor = Color.Gray

cs1.ForeColor = Color.Red

cs1.Border.Color = Color.Yellow
cs1.Border.Direction = 2

 

'g.Cols(1).Style.BackColor = Color.Blue

'g.styles.Normal.Border.Color = Color.Red
'g.styles.Normal.Border.Style = 1
'g.styles.Normal.Border.width = 5
'g.styles.Normal.Border.Direction = 2 '0-2

 

 


 回到顶部