Data binding on usercontrol does not work

  • Thread starter Thread starter Tsair
  • Start date Start date
T

Tsair

I do a custom user control with a textbox and button control and binding the
data to Text property, when i save the record it does not save into table.
Any wrong in my code ?

namespace winControl
{

[System.ComponentModel.DefaultBindingProperty("Text")]
public partial class DateTimeTextBox2 : UserControl
{
public DateTimeTextBox2()
{

InitializeComponent();
}

[System.ComponentModel.Bindable(true), Browsable(true), Category
("Behavior"), Description("Date and Time displayed")]
public override string Text
{
get { return this.textBox.Text;}
set { this.textBox.Text = value; }
}

}
}
 
I found the solution,

I changed the property Text to DataText, it work.
Why i can not use Text as my binding property ?
 
Back
Top