473,396 Members | 1,847 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.

DateTime Picker behavior issues

Hi all.

using vs.net 9, C#

I've got a trivial dilemma right now with my datetimepicker.

It is bound to a datetime field in a database. This field is also set to not
allow nulls. The default value of this field is: getdate()

My Picker's properties:
DataBindings -Value ->tblDataBindingSource - WeDate

This is the only property besides the name that I have changed.

Now, I have a it sitting on a form, where I am updating the tblData.
Currently, the picker shows the current date (as told to with the default
value). My problem:

The WeDate field for a new record will, 90% of the time, use the current
day's date. So...theoretically, when the user is entering data, if they need
today's date, they shouldn't have to even TOUCH the picker, right??????

Please correct me if I am wrong. It will explain a lot.

Well, I have a problem. If the user is entering data, and wants to use the
date that is displayed (getdate()) on startup, they MUST drop the calendar
down and select the date again, even though it already had the correct date
to begin with. Otherwise, if they press save, it throws an exception saying
it needs a value in WeDate.

I thought setting a default value would make it DEFAULT to today's date
unless otherwise specified. Or, at least it should.

I've tried a few things, on AddingNew for the tblDataBindingSource event:

setting the focus to the picker (did nothing)
tried using the enter and dropdown events (i'm not sure what this did - - i
probably did it wrong)

I've also tried messing with some of the datetimepicker's properties:

checked and moving the databinding to text

Nothing works.

My question: Is there any way to programmatically drop the picker and select
the current date?

That is the only way to get the date to stick to the record. I don't know
what else to try...and there is not much documentation on this type of
problem (at least from what I've found).

Thanks for any help!

Nov 7 '08 #1
0 2170

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

Similar topics

1
by: Colin Joss | last post by:
Sorry folks, being a bit dense here. I need a DateTime Picker for a PDA application I'm building. Couldn't see one in the standard tools so search Microsoft. Found one. Downloaded it. Now...
0
by: Ata İsmet Özçelik | last post by:
Hi there, I have a problem with the DateTime picker.. I want to use my custom format; for this I can give a string for the format.But My goal is to have the month name in the box in upper case...
1
by: Dean L. Howen | last post by:
Dear friends, Could you help me to solve the problem: How can we set/get NULL values of datetime in DatetimePicker ? I design a form using DateTimePicker to input/output date value, but the date...
9
by: Phil B | last post by:
I am having a problem with a datetime from a web services provider The provider is sending the following SOAP response <?xml version="1.0" encoding="utf-8"?> <soap:Envelope...
2
by: Ryan | last post by:
My form includes a field of the DateTime type. I want to allow the user to be able to set both the date and the time. By default the DateTimePicker shows just the date and calendar, the time is...
5
by: Michel Posseth [MCP] | last post by:
Hello we have encountered the following problems with the date time picker control A : datetime picker control gives focus to last entered field when moving back and forward with focus how do...
1
mafaisal
by: mafaisal | last post by:
Hello Experts I am Using vb.net 2005 Hw To Put DateTime Picker in Datagrid view I have to sea Datetime Picker in Specified Cilomn of Datagrid I try This But The Location Hw To Change to the...
4
by: gggram2000 | last post by:
Hi, I'm using php 5.2.3 with mysql server 5.1 as backend. I have a program in which a person enters or chooses two dates from two datetime pickers and other info, I'm not sure if the problem is...
1
by: sonubaba | last post by:
hello, my question is, in my web application i need datetime picker control in which user can select both date and time from DateTime Picker control i could not find this anywhere on inter net ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.