以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 不知道为什么,TextBox不显示数据了 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=145802) |
||||
-- 作者:hongye -- 发布时间:2020/2/7 18:16:00 -- 不知道为什么,TextBox不显示数据了 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不显示数据了
|
||||
-- 作者:有点蓝 -- 发布时间:2020/2/7 20:05:00 -- 请上传实例测试 |
||||
-- 作者:hongye -- 发布时间:2020/2/7 20:48:00 --
|
||||
-- 作者:有点蓝 -- 发布时间:2020/2/7 21:25:00 -- 事件里e.Row.Text 指的是listview的第一列的数据,但并不是每个表的第一列。再说,生成listview数据的时候,给listview的第一列赋值的如表A是"面料名称"(vr("项目名称") = dr("面料名称")),这个"面料名称"也不是表A的第一列。所以下面代码是永久都没有结果的 Dim c As Col = Tables(n).Cols(0) ‘Cols(0)表示第一列,表如A第一列是序号,不是"面料名称" Dim r As Integer = Tables(n).FindRow( c.Name & "= \'" & e.Row.Text & "\'") |