473,327 Members | 2,074 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 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 8004
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: D Witherspoon | last post by:
I am developing a Windows Forms application in VB.NET that will use .NET remoting to access the data tier classes. A very simple way I have come up with is by creating typed (.xsd) datasets. For...
0
by: MuZZy | last post by:
Hi, I have a user control with a textBox on it. The requirement is to bind the UserControl in the app, like UserControl.DataBindings.Add(...), but in fact internally this binding should flow...
2
by: paul meaney | last post by:
All, myself and another developer have been staring blankly at a screen for the past 48 hours and are wondering just what stunningly obvious thing we are missing. We are trying to load up 2...
2
by: Sascha | last post by:
Hi there, I searched carefully through the web before finally deciding to post this message, because I could not find a solution for my problem. Hopefully someone will have a hint or explanation...
41
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based...
4
by: emzyme20 | last post by:
Hi, I am trying to populate a list control that is bound to a data table but the display member needs to come from a different data table. I have two list controls in C#, one displaying...
6
by: p.mc | last post by:
Hi all, I'm having major problems with a userControl which contains a datagrid. My problem concerns data binding. The Page_Load() procedure calls the DataBind procedure to bind the datagrid...
1
by: Stephen Barrett | last post by:
I have an application that was originally built with ASP.Net 1.1. We finally got permission to migrate to 2.0. Due to time constraints we migrated the web projects to 2.0 web application...
0
by: furqanms | last post by:
Hello, I am new to WPF ,I am developing touch screen system using WPF. I am facing problem in Binding relative reference. Here is my code : <UserControl x:Class="uctlBrowser" ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.