DataTables("fsuf_pmc").LoadFilter = "[gxda] = '2区油磨'"
DataTables("fsuf_pmc").Load
Dim drs As List(Of DataRow)
Dim rx As Row = Tables("fsuf_pmc").Current
Dim lvw As WinForm.ListView = e.Form.Controls("ListView1")
lvw.StopRedraw() '暂停绘制
lvw.Columns.Clear() '清除原来的列
lvw.Rows.Clear() '清除原来的行
lvw.View = ViewMode.Details '显示模式为详细信息
lvw.GridLines = True '显示网格线
Dim cls() As String = {"加工单号","代码","业务员","重量","排产序号","排产工序","工序单号"} '指定要显示的各列
Dim wds() As Integer = {200,150,150,120,260,260,0} '定义列宽
For i As Integer = 0 To cls.Length - 1
Dim c As WinForm.ListViewColumn = lvw.Columns.Add()
c.Name = cls(i) '指定列名
c.Text = cls(i)'指定列标题
c.Width = wds(i) '指定列宽
c.TextAlign = HorizontalAlignment.Center
Next
drs = DataTables("fsuf_pmc").Select("[gxda] = '" & rx("gxda") & "' and [already]= TRUE and [complete] =false" )
For Each dr As DataRow In drs
Dim r As WinForm.ListViewRow = lvw.Rows.Add() '增加一行
r("加工单号")=dr("ccode")
r("业务员")=dr("cPsn_Name")
r("排产序号")=dr("production")
r("排产工序")=dr("gxda")
r("代码")=dr("ccuscode")
r("重量")=dr("iquantity")
r("工序单号")=dr("gxccode")
If dr("insertsheet") = True Then
r.BackColor = Color.Wheat
End If
Next
lvw.ResumeRedraw() '恢复绘制