471,348 Members | 1,325 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 software developers and data experts.

Data binding on usercontrol does not work

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

}
}
Feb 18 '06 #1
1 7823
I found the solution,

I changed the property Text to DataText, it work.
Why i can not use Text as my binding property ?
"Tsair" <ls*****@yahoo.com> wrote in message
news:O7**************@TK2MSFTNGP10.phx.gbl...
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; }
}

}
}

Feb 20 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by D Witherspoon | last post: by
reply views Thread by MuZZy | last post: by
2 posts views Thread by paul meaney | last post: by
2 posts views Thread by Sascha | last post: by
6 posts views Thread by p.mc | last post: by
1 post views Thread by Ronak mishra | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.