Conversion from Date to Integer not valid

2 posts, 0 answers
  1. mac
    mac avatar
    137 posts
    Member since:
    May 2008

    Posted 22 May 2008 Link to this post

    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">

  2. Steve
    Admin
    Steve avatar
    10940 posts

    Posted 23 May 2008 Link to this post

    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
Back to Top