If e.Row.Selected Then
Dim n As String = "表" & e.Row.Group.SubString(1,1)
'MessageBox.Show(e.Row.Group.SubString(0,2))
Dim rg As WinForm.RecordGrid = e.Form.Controls("RecordGrid1")
If DataTables.Contains(n)
If rg.Table Is Nothing OrElse rg.Table.Name <> n Then
For i As Integer = 0 To 4
Tables(n).Cols(i).ShowInRecordGrid = False '前面4列不在记录窗口显示
Next
rg.Table = Tables(n) '指定绑定表
rg.Build()
End If
Dim c As Col = Tables(n).Cols(0)
Dim r As Integer = Tables(n).FindRow( c.Name & "= '" & e.Row.Text & "'")
If r > -1 Then
Tables(n).Position = r
For i As Integer = 1 To DataTables(n).DataCols.Count - 10
Dim tb As String = "TextBox" & i
If e.Form.Controls(tb).Visible = False Then
e.Form.Controls(tb).Visible = True
e.Form.Controls(tb).Value = Tables(n).Current(i+4)
Else
e.Form.Controls(tb).Value = Tables(n).Current(i+4)
End If
Next
End If
Else
For i As Integer = 0 To 4
Tables("涤式").Cols(i).ShowInRecordGrid = False '前面4列不在记录窗口显示
Next
rg.Table = Tables("涤式")
rg.Build()
End If
Dim c1 As Col = Tables("涤式").Cols(0)
Dim r1 As Integer = Tables("涤式").FindRow( c1.Name & "= '" & e.Row.Text & "'")
If r1 > -1 Then
Tables("涤式").Position = r1
For i As Integer = 1 To Tables("涤式").Cols.Count
If Tables("涤式").Cols.Count >= 15
Dim tb As String = "TextBox" & i
If Tables("涤式").Current(i-1) IsNot Nothing Then
If e.Form.Controls(tb).Visible = False Then
e.Form.Controls(tb).Visible = True
e.Form.Controls(tb).Value = Tables("涤式").Current(i-1)
Else
e.Form.Controls(tb).Value = Tables("涤式").Current(i-1)
End If
Else
If e.Form.Controls(tb).Visible = False Then
e.Form.Controls(tb).Visible = True
e.Form.Controls(tb).Value = Nothing
Else
e.Form.Controls(tb).Value = Tables("涤式").Current(i-1)
End If
End If
Else
Dim tb As String = "TextBox" & i
If Tables("涤式").Current(i-1) IsNot Nothing Then
If e.Form.Controls(tb).Visible = False Then
e.Form.Controls(tb).Visible = True
e.Form.Controls(tb).Value = Tables("涤式").Current(i+4)
Else
e.Form.Controls(tb).Value = Tables("涤式").Current(i+4)
End If
End If
For i1 As Integer = Tables("涤式").Cols.Count+1 To 6
Dim tb1 As String = "TextBox" & i1
e.Form.Controls(tb1).Visible = False
Next
End If
Next
End If
End If
不知道为什么,TextBox不显示数据了