Foxtable(狐表)用户栏目专家坐堂 → [求助] drawcell 代码优化问题


  共有3353人关注过本帖平板打印复制链接

主题:[求助] drawcell 代码优化问题

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


加好友 发短信
等级:六尾狐 帖子:1287 积分:10362 威望:0 精华:1 注册:2018/1/20 12:40:00
  发帖心情 Post By:2018/4/25 9:32:00 [只看该作者]

子表 Afterload 事件:
Dim tbs() As String = {"XMFP","XMZB.XMFP"}
    For Each s As String In tbs
        Dim t As Table = Tables(s)
        
        For Each tr As Row In t.Rows
            Dim xl As Integer=  tr.Index + 1
            Dim yl As Integer=  t.Cols("缩略图").Index + 1
            Dim cs1 As C1.Win.C1FlexGrid.CellStyle = t.grid.Styles.Add(tr("_Identify"))
            If tr("缩略图") > ""  Then
                If FileSys.FileExists("\\SERVER\Foxtemp$\"  & tr("缩略图")) Then
                    cs1.BackgroundImage = getimage( "\\SERVER\Foxtemp$\"  & tr("缩略图"))
                    cs1.Display =  C1.Win.C1FlexGrid.DisplayEnum.ImageOnly
                    cs1.BackgroundImageLayout = C1.Win.C1FlexGrid.ImageAlignEnum.Stretch
                Else
                    ' MessageBox.Show("1")
                    cs1.BackgroundImage = getimage("Images\failed.ico")
                    cs1.Display =  C1.Win.C1FlexGrid.DisplayEnum.ImageOnly
                    cs1.BackgroundImageLayout = C1.Win.C1FlexGrid.ImageAlignEnum.Stretch
                End If
                t.grid.SetCellStyle(xl,yl, CS1)
         End If
            
        Next
    Next

子表 datacolchanged
If e.DataCol.Name = "缩略图" Then
    
    Dim tbs() As String = {"XMFP","XMZB.XMFP"}
    For Each s As String In tbs
        Dim t As Table = Tables(s)
        
        For Each tr As Row In t.Rows
            Dim xl As Integer=  tr.Index + 1
            Dim yl As Integer=  t.Cols("缩略图").Index + 1
            Dim cs1 As C1.Win.C1FlexGrid.CellStyle = t.grid.Styles.Add(tr("_Identify"))
            If tr("缩略图") > ""  Then
                If FileSys.FileExists("\\SERVER\Foxtemp$\"  & tr("缩略图")) Then
                    cs1.BackgroundImage = getimage( "\\SERVER\Foxtemp$\"  & tr("缩略图"))
                    cs1.Display =  C1.Win.C1FlexGrid.DisplayEnum.ImageOnly
                    cs1.BackgroundImageLayout = C1.Win.C1FlexGrid.ImageAlignEnum.Stretch
                Else
                    ' MessageBox.Show("1")
                    cs1.BackgroundImage = getimage("Images\failed.ico")
                    cs1.Display =  C1.Win.C1FlexGrid.DisplayEnum.ImageOnly
                    cs1.BackgroundImageLayout = C1.Win.C1FlexGrid.ImageAlignEnum.Stretch
                End If
                t.grid.SetCellStyle(xl,yl, CS1)
            Else cs1.BackgroundImage = Nothing
            End If
            
        Next
    Next
End If
另外还有个问题就是,筛选之后,图片就没有了。。
[此贴子已经被作者于2018/4/25 9:46:17编辑过]

 回到顶部
总数 32 1 2 3 4 下一页