当我在设置绑定源之前设置转发器的数据源时,这发生在我身上一次。我希望它为您指明正确的方向。这是我的代码的摘录
Dim sres As New frmSearchResults
Dim dt As DataTable = resultsDataTable
With sres
.lblDate.DataBindings.Add(New Binding("Text", dt, "createtime", True))
.lblOwner.DataBindings.Add(New Binding("Text", dt, "owner", True))
.lblTicketNumber.DataBindings.Add(New Binding("Text", dt, "ticketnumber", True))
.lblTitle.DataBindings.Add(New Binding("Text", dt, "tickettitle", True))
.txtExcerpt.DataBindings.Add(New Binding("Text", dt, "excerpt", True))
.btnLoad.DataBindings.Add(New Binding("Tag", dt, "ticketid", True))
.dr1.DataSource = dt 'this used to come before my bindings above
sres.Show()
End With