Clearing textbox on add when bindings set dynamically


Author
Message
Keith Chisarik
Keith Chisarik
StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)StrataFrame VIP (1.5K reputation)
Group: StrataFrame Users
Posts: 939, Visits: 40K
I have a form that serves as a single maintenance form for many very simple BO's. The user selects the table they want to maintain and the control bindings are created, all works fine but the textboxes would NOT clear upon a call to the forms add method. Eveything else worked fine. I added an event handler to manually clear it but I am wondering why I had to do that and if anything is "wrong" since it didnt work as expected. Any ideas?

Binding Code Snippet:

Dim strBOname As String = cboTables.SelectedValue

Dim typeRef As Type

typeRef = MicroFour.StrataFrame.Tools.Common.GetTypeFromReferencedAssemblies(strBOname)

boMaintenance = CType(Activator.CreateInstance(typeRef), BusinessLayer)

boMaintenance.ParentContainer = Me

boMaintenance.SynchronizingObject = Me

Me.BusinessObjects.Add(boMaintenance)

txtValue.BusinessObject = boMaintenance

txtValue.BindingField = boMaintenance.AllFieldsList.Find(AddressOf findBindingValue)

txtValue.Refresh()

Dim boCastToParent As Object

boCastToParent = CType(boMaintenance, RTIC.BUSINESS.SQLBASEBO)

boCastToParent.FillByTableName(cboTables.Text)

boMaintenance.CopyDataFrom(boCastToParent, BusinessCloneDataType.ClearAndFillFromDefaultView)

boMaintenance.Filter = boMaintenance.AllFieldsList.Find(AddressOf findPKField) & " >= 10"

boMaintenance.SetDirtyOnEdit = True

Me.PrimaryBusinessObject = boMaintenance

For Each Control In Me.pnlAllControls.Controls

If TypeOf (Control) Is UI.SDSI_cmdDataButton Then

CType(Control, UI.SDSI_cmdDataButton).BusinessObject = Me.PrimaryBusinessObject

End If

Next

boMaintenance.Navigate(BusinessNavigationDirection.First)

Me.pnlAllControls.Visible = True

updateButtonState()

Me.cboTables.Visible = False

Me.lblSelection.Visible = False

Me.RefreshBusinessObjects()

Me.Refresh()

AddHandler boMaintenance.EditingStateChanged, AddressOf ClearTextBox



Keith Chisarik
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search