Update Textbox display after updating value in data table binding source

  • Thread starter Thread starter Shan1986
  • Start date Start date
S

Shan1986

Guest
Hallo,

I have a text box(to display not to enter) bound to data table field with binding source. This field is calculated by by a sub and the value is set like this.

Textbox_Area.Databindings.add( "Text, BS, "Area", True, True, DataSourceUpdateMode.OnPropertyChanged)


Sub Calculate_Area()

Dim r = TryCast(BS.Current, DataRowView)

If r IsNot Nothing Then

r("Area")= calculatedresult

End If

End sub


I also have binding complete sub which works when changing the values normally in controls.

Sub BindingComplete(ByVal sender As Object, ByVal e As BindingCompleteEventArgs)

If e.BindingCompleteContext = BindingCompleteContext.DataSourceUpdate AndAlso e.Exception Is Nothing Then e.Binding.BindingManagerBase.EndCurrentEdit()

End Sub

In this way it is not showing the updated value when i change some parameter in the current record.

How to force the textbox to display the updated value? . Or run Bindingcomplete sub manually for the textbox?.

Thanks

Continue reading...
 
Back
Top