最加数据后不排序,默认是在最后一行的,比如我这样
If e.Col.name = "查看" Then
Dim r As Row = Tables("待办事项").Current
Dim dd As String = r("ID")
Dim nm As String = r("表名")
Dim ck As String = r("页签名")
If DataTables.Contains(nm) = False
DataTables.Load(nm)
End If
Functions.Execute("增加页签",ck,ck)
DataTables(nm).Save() '接下来要根据主键查找,必须先保存,因为只有保存后新增行的主键才是有效值.
Dim dr As DataRow = DataTables(nm).Find("[ID] = '" & dd & "'")
If dr Is Nothing Then
DataTables(nm).AppendLoad("[ID] = '" & dd & "'")
dr = DataTables(nm).Find("[ID] = '" & dd & "'")
Else
dr.Load()
End If
If dr IsNot Nothing Then
Dim wz As Integer = Tables(nm).FindRow("[ID] = '" & dd & "'")
If wz < 0 Then '如果因为筛选导致此合同签订类不可见
Tables(nm).Filter = ""
wz =Tables(nm).FindRow(dr)
End If
If wz >= 0 Then
Tables(nm).Position = wz
Tables(nm).TopVisibleRow = wz '定位行后设置为第一个可见行位置,http://www.foxtable.com/webhelp/scr/2358.htm
End If
End If
End If