473,396 Members | 1,775 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,396 software developers and data experts.

Problem Updatinh Databound TextBox when Underlying Property Changes

Hello:

We have a class with a DateTime property and a string property that
represent that same date. We bind our text boxes to the string
property. We do this so that our users can enter dates in various
formats.

Inside the string property we verify the date format and conditionally
set the DateTime property.

Additionally, we have the getter of the string property format the
date.

The problem is that the unformatted text remains in the text box. We
are expecting the formatted string to appear after the user tabs away.
We have tried setting the type of binding to be OnPropertyChanged, but
this doesn't work.

We are not sure how to tell the interface to refresh. I also get the
feeling that we are not utilizing one of Windows Forms' built-in
features.

Please let me know if a string property is not the way to go. I would
much rather do things in a standard fashion. Any suggestions would be
appreciated.

Thanks,
Travis
Jul 7 '08 #1
1 1273
je**********@gmail.com skrev:
Hello:

We have a class with a DateTime property and a string property that
represent that same date. We bind our text boxes to the string
property. We do this so that our users can enter dates in various
formats.

Inside the string property we verify the date format and conditionally
set the DateTime property.

Additionally, we have the getter of the string property format the
date.

The problem is that the unformatted text remains in the text box. We
are expecting the formatted string to appear after the user tabs away.
We have tried setting the type of binding to be OnPropertyChanged, but
this doesn't work.

We are not sure how to tell the interface to refresh. I also get the
feeling that we are not utilizing one of Windows Forms' built-in
features.

Please let me know if a string property is not the way to go. I would
much rather do things in a standard fashion. Any suggestions would be
appreciated.
Isn't it better use a DateTimePicker instead of a TextBox to avoid all
kind of errors that a user can do by manually enter a date?

--
Bjørn Brox
Jul 7 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Daniel | last post by:
when i set the BackgroundImage property in the designer the image still doesnt show in the background of the textbox any other property must be set?
4
by: John Rose | last post by:
I have one databound TextBox on a page with one button. The TextBox loads the correct SQL record data but typing a new string into the Textbox fails to change the DataSet. Any ideas? There must...
7
by: siddhiash | last post by:
Hi Friends I want to add PasswordChar Property which shows ****** for string which I type in PropertyGrid Control. Regards, Siddharth
1
by: David Veeneman | last post by:
This posting is for the Google crawler and requires no response. I have created a multi-level object hierarchy, in which the root object needs to be notified whenever any property of any object...
1
by: Sam Kong | last post by:
Hi, I want to trigger an event handler when a property changes. If the property is set via a function, it's simple to trigger the attached event handler. But if the property is set directly, I...
2
by: sukeshchand | last post by:
How to prevent changes in textbox when we use Ctrl+V or Paste using mouse without effecting the previously stored values in the text box. I want to Prevent the changes in the textbox by using...
4
by: Mark Olbert | last post by:
I've written a composite custom control which I would like to have update its design-time display when one of several properties changes at design time. These custom properties are not simply the...
9
by: Kyote | last post by:
I have a textbox that is databound to a table in an access database. The field only contains month/day/year but my databound textbox is also showing a time. Is there any way to prevent it from...
3
NawazAhmed
by: NawazAhmed | last post by:
Hi, I am working with Visual Studio 2003, framework 1.1 I am trying to focus a textbox when page loads. I tried Page.RegisterStartupScript("focus",...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.