隐藏行代码,报错,需如何修改?
Dim 表控件 As WinForm.Table = e.Form.Controls("合同进度")
Dim 操作表 As Table = 表控件.Table
For i As Integer = 1 To 操作表.grid.Rows.count - 1
If 操作表.grid.Rows(i)("生产单位") = "所有" AndAlso 操作表.grid.Rows(i)("CMID") = "所有" Then
操作表.grid.Rows(i).visible = e.Sender.Checked
End If
Next
[此贴子已经被作者于2024/5/24 19:43:20编辑过]
For i As Integer = 1 To 操作表.grid.Rows.count - 1
If 操作表.grid.Rows(i)("生产单位") <> System.DBNull.Value Then
If 操作表.grid.Rows(i)("生产单位") = "所有" AndAlso 操作表.grid.Rows(i)("CMID") = "所有" Then
操作表.grid.Rows(i).visible = e.Sender.Checked
End If
End If
Next
Dim 表控件 As WinForm.Table = e.Form.Controls("合同进度")
Dim 操作表 As Table = 表控件.Table
If 操作表.grid.Rows.count <= 0 Then
Return
End If
For i As Integer = 0 To 操作表.grid.Rows.count - 1
If 操作表.grid.Rows(i)("生产单位") <> System.DBNull.Value Then
If 操作表.grid.Rows(i)("生产单位") = "所有" AndAlso 操作表.grid.Rows(i)("CMID") = "所有" Then
操作表.grid.Rows(i).visible = e.Sender.Checked
End If
End if
Next
[此贴子已经被作者于2024/5/24 19:43:40编辑过]
For i As Integer = 0 To 操作表.grid.Rows.count - 1
If 操作表.grid.Rows(i)("生产单位") isnot System.DBNull.Value Then
If 操作表.grid.Rows(i)("生产单位") = "所有" AndAlso 操作表.grid.Rows(i)("CMID") = "所有" Then
或者
For i As Integer = 0 To 操作表.grid.Rows.count - 1
If 操作表.grid.Rows(i)("生产单位").ToString = "所有" AndAlso 操作表.grid.Rows(i)("CMID").ToString = "所有" Then
操作表.grid.Rows(i).visible = e.Sender.Checked
End If
Next