Data binding on usercontrol does not work

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; }
}

}
}
 
T

Tsair

I found the solution,

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top