This is a migrated thread and some comments may be shown as answers.

DateTime Picker data type conversion error

2 Answers 104 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
chris
Top achievements
Rank 2
chris asked on 15 Jan 2008, 01:53 PM

Being relatively new to these controls and design in general, I;ve come up against an unexpected error meesage.

I have a radgrid which pulls out data from a sql table, one field of which is a datetime in the database.  On entry to the table the date field is left as null for later updating.

I have set up an edit template which includes a datetime picker. This countrol is bound to the field and when going into edit mode I'm getting the following message:

Conversion from type 'Date' to type 'Integer' is not valid. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Conversion from type 'Date' to type 'Integer' is not valid.

Is there a reason why the datetime picker control would store the values as an integer rather than a datetime string ?

How can I get around this ?

any help would be greatly appreciated
ChrisS

2 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 15 Jan 2008, 05:06 PM
Hello Chris,

You could take a look at the following links which described the usage of DatePicker with Grid:

 http://www.telerik.com/support/kb/article/b454K-gmg-b454T-cbb-b454c-cbb.aspx

http://www.telerik.com/community/code-library/submission/b311D-dgkaa.aspx

Please go through these resources and let us know if further help is needed.

Kind regards,
Maria Ilieva
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
chris
Top achievements
Rank 2
answered on 22 Jan 2008, 08:30 AM
That's great thanks - have used the the GridTemplateColumn in an auto generated form template.
Tags
Calendar
Asked by
chris
Top achievements
Rank 2
Answers by
Maria Ilieva
Telerik team
chris
Top achievements
Rank 2
Share this question
or