以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  剩余交货天数排序  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=190919)

--  作者:15666282205
--  发布时间:2024/3/14 10:34:00
--  剩余交货天数排序
老师,我用下面的代码计算剩余交货天数,想按大小排序,可是点击表头排序不正常,不是按大小顺序。请您指导
If e.Col.name = "交货天数" Then
    If e.Row.IsNull("交货日期") Then
        e.text = Nothing
    Else
        e.text = (CDate(e.Row("交货日期"))-Date.today).TotalDays
    End If
End If

--  作者:有点蓝
--  发布时间:2024/3/14 10:41:00
--  
代码改改放到datacolchanged事件,不能用到drawcell事件
--  作者:15666282205
--  发布时间:2024/3/14 11:08:00
--  
老师,代码改改放到datacolchanged事件后提示错误:
编译错误:col is not a member of datacolevenargs
错误代码:If e.Col.name = "交货天数" Then

--  作者:有点蓝
--  发布时间:2024/3/14 11:21:00
--  
要改改的,先看看:http://www.foxtable.com/webhelp/topics/0604.htm

If e.dataCol.name = "交货天数" Then