![]() |
|
||||||||||||||
| | 网站首页 | 数据库教程 | web编程 | 服务器 | 程序设计 | | ||
|
||
|
||||||
| spread中datafill事件为什么不起作用? | ||||||
作者:佚名 文章来源:不详 点击数: 更新时间:2007-8-6 ![]() |
||||||
|
sdivad帮助中如是说: Occurs for each cell in the fpSdivad 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以后,却只有一列起作用,为什么? 我试了好久也没有解决,后来仔细研究了一下sdivad附带的范例,其是一个正在采用了这一事件: sdivad.row = -1 sdivad.Col = 1 sdivad.DataField = "Id" sdivad.DataFillEvent = False ''这里 sdivad.Celltype = 3 sdivad.Col = 2 sdivad.DataField = "Name" sdivad.DataFillEvent = False ''这里 sdivad.Celltype = 1 sdivad.Col = 3 sdivad.DataField = "YesNo" sdivad.DataFillEvent = True 'fire datafill event so we can make cells say yes or no sdivad.Celltype = 1![]() 原来DataFillEvent是对每一列的有效的。
他的DataFill事件是这样写的,也可以参照一下! Private Sub sdivad_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 sdivad.Col = Col sdivad.row = row ret = sdivad.GetDataFillData(v, 11) If v = 0 Then sdivad.Text = "No" Else sdivad.Text = "Yes" End If Cancel = True Else sdivad.Col = Col sdivad.row = row If sdivad.Text = "Yes" Then v = 1 Else: v = 0 End If ret = sdivad.SetDataFillData(v) Cancel = True End If End If End Sub![]()
另外,要注意SetDataFillData和GetDataFillData只能用于DataFill事件中,在其它地方使用是无效的! 本文来源:http://blog.csdn.net/lanman/archive/2007/07/21/1701286.aspx
|
||||||
| 文章录入:admin 责任编辑:admin | ||||||
| 【发表评论】【加入收藏】【告诉好友】【打印此文】【关闭窗口】 | ||||||
| 网友评论:(只显示最新10条。评论内容只代表网友观点,与本站立场无关!) |
| | 设为首页 | 加入收藏 | 联系站长 | 友情链接 | 版权申明 | 网站公告 | 网站地图 | 管理登录 | | |||
|