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

Conversion from Date to Integer not valid

1 Answer 106 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
mac
Top achievements
Rank 1
mac asked on 22 May 2008, 05:15 PM
very strange.
standard Gridview
Calling DateTime column with valid DateTime data from SQL ds. Update works fine when a textbox.

<

EditItemTemplate>

<telerik:RadDateTimePicker ID="RadDateTimePicker2" runat="server" AutoPostBackControl='<%# Eval("EducationDate") %>'

Culture="English (United States)">

<DateInput InvalidStyleDuration="100">

</DateInput>

</telerik:RadDateTimePicker>

</EditItemTemplate>

error returned = 

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.

Source Error:

Line 25:                 <asp:TemplateField HeaderText="EducationDate" SortExpression="EducationDate">
Line 26:                     <EditItemTemplate>
Line 27: &nbsp;<telerik:RadDateTimePicker ID="RadDateTimePicker2" runat="server" AutoPostBackControl='<%# Eval("EducationDate") %>'Line 28:                             Culture="English (United States)">
Line 29:                             <DateInput InvalidStyleDuration="100">

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 23 May 2008, 08:38 AM
Hello mac,

The AutoPostBackControl property serves a purpose to indicate whether a postback to the server will occur at all and if yes on which control changes and it cannot be used in such a way. What you are probably looking for is the DbSelectedDate property.

All the best,
Steve
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Calendar
Asked by
mac
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or