473,508 Members | 2,008 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datagrid DateTimepicker column style

Hi, .Net experts,

I am using DatagridDateTimepickerColumn style posted on MSDN .net class
document in my datagrid. You can see the datagridDateTimepickerColumn style
at
http://msdn.microsoft.com/library/de...classtopic.asp

It works fine with the datetimepicker column of current record in datagrid.
But when I click the very last record in datagrid (which creates a record), I
got an exception. I debuged it. It occured right after leaving Edit
function. Can somebody tell me the reasion and how to fix it?

Thanks,

Karl

Nov 17 '05 #1
1 3802
Hi Karl
I am using DatagridDateTimepickerColumn style posted on MSDN .net class
document in my datagrid. You can see the datagridDateTimepickerColumn style
at:
http://msdn.microsoft.com/library/de...classtopic.asp

It works fine with the datetimepicker column of current record in datagrid.
But when I click the very last record in datagrid (which creates a record), I
got an exception. I debuged it. It occured right after leaving Edit
function. Can somebody tell me the reasion and how to fix it?


The standard DateTimePicker control from .NET does not support null values.
Its value property must always be a valid DateTime value.

When you click on the last line in the datagrid and thus create a new
record, what happens with your DateTime value? Is it set to DateTime.Now?
Or is it initalized with null? If the latter, you would try to set the
DateTimePickers value property to null and that would raise an exception.

If that is the problem you should use a DateTimePicker control that
supports null values like this one:
http://www.codeproject.com/cs/miscct...TimePicker.asp

hth
--
Claudio Grazioli
http://www.grazioli.ch
http://www.grazioli.ch/HommingbergerGepardenforelle/
Nov 17 '05 #2

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

Similar topics

1
2581
by: Soul | last post by:
*** I am not sure this question belong to *.languages.csharp or *.framework.windowsdorms.databinding, so I post to both *** Hi, Currently I have a DataGrid which bind to a DataSet. One of...
0
3532
by: Mauro | last post by:
Hi, I need a big help to resolve this problem. I need to put a usercontrol in a datagrid: this control check if the code inserted is present in a archive and if not return a error message. (In...
1
9328
by: Marty | last post by:
Is it possible to have a DateTimePicker in a DataGrid control date column? If so, can you please include some code. Thanks.
0
1642
by: ROG | last post by:
Hi all with help from postings on the web, i have a dateTimePicker in one of my columns in the datagrid. However, when i move in to this column using the arrow keys, it automatically pops up,...
6
3478
by: Michael | last post by:
Hi all : I want to add button , dtpicker and combo box into datagrid. I don't want use 3rd party and I want write my own columnstyles. any reference / site to teach me how to do it ? ...
1
1674
by: Robert Batt | last post by:
Hello, I have a bound datagrid that contains the following date column Dim tcQuoteduedate As New DataGridTextBoxColum tcQuoteduedate.MappingName = "MYCustomerCustomerTQuoteDueDate...
0
1185
by: henk | last post by:
Hi, In my datagrid, a date time picker becomes visible when a user navigates to eg column 3. (with CurrentCellChanged and datetimepicker1.AddReqInfo.Visible = True) This works fine BUT: When I...
1
1042
by: rgirdler | last post by:
Greetings, can anyone tell me how to add the datetimepicker tool to a specific column in the datagrid when using C# ? I''ve tried to go through the datagrid> edit columns and then selecting the...
0
5635
by: priyamtheone | last post by:
I'm trying to make a datagridview column to act like a datetimepicker column (C#.Net 2005). These are the behaviours that the dgv should have: 1) Initially all the cells of the dtp column should be...
0
7227
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
7127
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
7391
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...
1
5056
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3204
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1564
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
768
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
424
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.