| re: TabControl & DataBinding
It should be a bug: Seems everytime back to page1 cause refreshing databind. Use following code to avoid the situation:
Private Sub txtVslName_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtVslName.TextChanged
bmSeaExHBL.EndCurrentEdit()
End Sub
"Agnes" wrote:
[color=blue]
> Now, I understand my problem (bugs?) about the Tab Control & dataBinding
> 1)a simple blank form with tabcontrol , there are 2 pages, pages1 got 3
> textboxes (txtShipperNAme,txtJobNo,txtVslName) and one "New" button
> 2)As Formload, I will fill in the dsInvoice and bind the data
> dsSeaExHBL.Clear()
> daSeaExHBL.Fill(dsSeaExHBL, "BillLadingHeader")
> bmSeaExHBL = Me.BindingContext(dsSeaExHBL, "BillLadingHeader")
> Me.txtShipperName.DataBindings.Add("text", dsSeaExHBL,
> "BillladingHeader.shippername")
> Me.txtVslName.DataBindings.Add("text", dsSeaExHBL,
> "BillladingHeader.vesselname")
> Me.txtJobNo.Text = ""
> 3) in New button's click Event,
> bmSeaExHBL.EndCurrentEdit()
> bmSeaExHBL.AddNew()
> 4) I start to input the data , then I click the Tab Page2, and then I click
> back Tab Page1.
> 5)Bugs:- txtShipperName & txtVslName 's Text got blank [It seems loss what I
> input before]
> 6) For txtJobNo, the data still remain in TextBox.
>
> What's wrong with Tab Control ???
> Thanks
> From Agnes
>
>
>
>[/color] |