子表 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编辑过]