这种情况,建议直接改成文件列
http://www.foxtable.com/webhelp/scr/1646.htm
如果要用图片列,那就在beforeAddFile事件写代码
If e.DataCol.Name = "产品" Then
Dim dlg As new OpenFileDialog
If dlg.ShowDialog = DialogResult.OK Then
Dim path = e.DataCol.DefaultFolder
If path = Nothing Then
path = ProjectPath & "attachments/"
End If
If FileSys.FileExists(path & e.DataRow(e.DataCol.Name)) Then
FileSys.DeleteFile(path & e.DataRow(e.DataCol.Name), 2, 2)
End If
e.DataRow(e.DataCol.Name) = FileSys.GetName(dlg.FileName)
End If
e.cancel = True
End If
[此贴子已经被作者于2018/3/20 8:54:27编辑过]