请问在下拉窗口用DataSource绑定了不同的表,应该如何用SetColVisibleWidth对不同的表进行列设置呢?
e.Form.DropDownBox.Select() '将输入焦点返回下拉列表框
Dim txt As String = e.Form.DropDownBox.Text
Dim r As Row = e.Form.DropTable.Current
Dim tb As Table = Tables("窗口12_Table1")
If txt = "" Then
tb.DataSource = DataTables("即时库存")
tb.Filter = ""
Else
txt = "'%" & txt & "%'"
If r.IsNull("工程项目") AndAlso r.IsNull("类别") Then
tb.DataSource = DataTables("即时库存")
tb.filter = "物料名称 Like " & txt
ElseIf r.IsNull("工程项目") AndAlso r("类别") = False Then
tb.DataSource = DataTables("即时库存")
tb.filter = "物料名称 Like " & txt & " [类别] = '" & r("类别") & "' and [库存数量] >0"
ElseIf r.IsNull("工程项目") = False AndAlso r.IsNull("类别") Then
tb.DataSource = DataTables("项目材料")
tb.filter = "物料名称 Like " & txt & " 工程项目 = '" & r("工程项目") & "' And 仓库数量 > 配发数量"
Else
tb.DataSource = DataTables("项目材料")
tb.filter = "物料名称 Like " & txt & " 工程项目 = '" & r("工程项目") & "' And [类别] = '" & r("类别") & "'And 仓库数量 > 配发数量"
End If
End If
e.Form.DropDownBox.Select()