这个问题无解。照抄了基本全部的代码,执行效率还是很低。
不清楚为什么Syscmd.Row.Delete能快速执行,我暂时没有找到变通方法。
如果你要临时移除,或者隐藏,你可以试试用filter、remove、visible等方式处理。
CurrentTable.addnew(5000)
Foxtable.Syscmd.stopredraw
CurrentTable.DataTable.StopRedraw
Dim lst As new List(of System.data.DataRow)
Dim view As System.data.dataview = BindTables(CurrentTable.name)
For i As Integer = 0 To view.count-1
Dim idx = CurrentTable.grid.Rows(i).DataIndex
If idx >= 0 Then
lst.add(view(idx).Row)
End If
Next
Dim enumerator As List(of system.data.DataRow).Enumerator = lst.GetEnumerator()
msgbox(123)
Do While enumerator.MoveNext
Dim current As system.data.DataRow = enumerator.Current
current.delete
'Dim grid As c1.win.c1flexgrid.C1FlexGridBase = CurrentTable.grid
'grid.removeitem(grid.Rows.count-1)
Loop
msgbox("aaa")
CurrentTable.DataTable.ResumeRedraw
Foxtable.Syscmd.ResumeRedraw