spread中datafill事件为什么不起作用?
来源:互联网 发布:地图路线标注软件 编辑:程序博客网 时间:2024/04/29 23:16
spread帮助中如是说:
Occurs for each cell in the fpSpread control before it receives data from the database and before it writes data to the database, if the DataFillEvent property is set to True for the cell.
但是设置了DataFillEvent=True以后,却只有一列起作用,为什么?
我试了好久也没有解决,后来仔细研究了一下spread附带的范例,其是一个正在采用了这一事件:
C:/Program Files/FarPoint Technologies/Spread70/Samples/ActiveX/VB6/Overview中的Bound.frm表单,它是这样写的
spread.row = -1
spread.Col = 1
spread.DataField = "Id"
spread.DataFillEvent = False ''这里
spread.Celltype = 3
spread.Col = 2
spread.DataField = "Name"
spread.DataFillEvent = False ''这里
spread.Celltype = 1
spread.Col = 3
spread.DataField = "YesNo"
spread.DataFillEvent = True 'fire datafill event so we can make cells say yes or no
spread.Celltype = 1
spread.Col = 1
spread.DataField = "Id"
spread.DataFillEvent = False ''这里
spread.Celltype = 3
spread.Col = 2
spread.DataField = "Name"
spread.DataFillEvent = False ''这里
spread.Celltype = 1
spread.Col = 3
spread.DataField = "YesNo"
spread.DataFillEvent = True 'fire datafill event so we can make cells say yes or no
spread.Celltype = 1
原来DataFillEvent是对每一列的有效的。
他的DataFill事件是这样写的,也可以参照一下!
Private Sub spread_DataFill(ByVal Col As Long, ByVal row As Long, ByVal DataType As Integer, ByVal fGetData As Integer, Cancel As Integer)
Dim v As Variant
Dim ret As Integer
If Col = 3 Then
If fGetData Then
spread.Col = Col
spread.row = row
ret = spread.GetDataFillData(v, 11)
If v = 0 Then
spread.Text = "No"
Else
spread.Text = "Yes"
End If
Cancel = True
Else
spread.Col = Col
spread.row = row
If spread.Text = "Yes" Then
v = 1
Else: v = 0
End If
ret = spread.SetDataFillData(v)
Cancel = True
End If
End If
End Sub
Dim v As Variant
Dim ret As Integer
If Col = 3 Then
If fGetData Then
spread.Col = Col
spread.row = row
ret = spread.GetDataFillData(v, 11)
If v = 0 Then
spread.Text = "No"
Else
spread.Text = "Yes"
End If
Cancel = True
Else
spread.Col = Col
spread.row = row
If spread.Text = "Yes" Then
v = 1
Else: v = 0
End If
ret = spread.SetDataFillData(v)
Cancel = True
End If
End If
End Sub
另外,要注意SetDataFillData和GetDataFillData只能用于DataFill事件中,在其它地方使用是无效的!
- spread中datafill事件为什么不起作用?
- Global中Application_Error为什么不起作用
- WPF中MouseDown事件不起作用
- 为什么在minicom串口中,键盘输入不起作用?
- 为什么jstl在页面中不起作用
- Spread的常用事件
- Spread的常用事件
- Spread的常用事件
- Spread的常用事件
- farpoint Spread 常用事件
- spread常用事件
- farpoint Spread 常用事件
- 鼠标事件不起作用在UserControl中
- jquery中取消绑定事件unbind不起作用
- 为什么clear:right不起作用
- @WebListener 为什么不起作用
- 为什么colorwithRGB不起作用?
- PATH变量为什么不起作用
- 如何做需求分析
- 由成幻OnlineJudge学习如何做自己的Acm-Icpc在线评判系统-目录
- 汇编入门
- ABAP 调试器简介
- 由成幻OnlineJudge学习如何做自己的Acm-Icpc在线评判系统-1.什么是OnlineJudge
- spread中datafill事件为什么不起作用?
- 数据库设计规范和值得注意的问题
- SAP 中的变式
- 网站项目计划书的写法如何写网站设计策划书
- Visual Studio 2008、SQL Server 2008和Windows Server 2008发布日期确定
- 常用破解工具
- ASP.NET网络编程中常用到的27个函数集
- 通用的分页存储过程
- oracle数据库备分