Click to See Complete Forum and Search --> : UserControl bind not saving


satanorz
December 15th, 2009, 03:53 PM
Hi there!

I'm coding an app using VB.NET 2005, and i've a small problem.
I've a custom control derived from UserControl, that has an overrided version of the Text property with Bindable set to true in two ways mode.
Here's the code of one of my tests:


Imports System.ComponentModel

Public Class DBFecha
<EditorBrowsable(EditorBrowsableState.Always), Browsable(True), DesignerSerializationVisibility(DesignerSerializationVisibility.Visible), Bindable(True, BindingDirection.TwoWay)> _
Public Overrides Property Text() As String
Get
Return Me.txtTexto.Text
End Get
Set(ByVal value As String)
Me.txtTexto.Text = value
End Set
End Property
End Class


txtTexto is a textbox that it is part of the class.

Project was built, and when i run the component in a sample form, the control retrieves the information of the dataset correcty, but it's not saving it.

In the form i've a simple textbox and a instance of the usercontrol, both binded to the same field of a dataset, one works both directions, but mine fails to save.

Any help will be appreciated ;)

Thanks for your time guys.