RadGrid and ObjectDataSource issue

2 posts, 0 answers
  1. archimede
    archimede avatar
    103 posts
    Member since:
    Jul 2006

    Posted 28 Apr 2010 Link to this post

    I have a RadGrid bounded with an ObjectDataSource. I have a DateTime parameter that gives some problem.
    When I try to update data i get the following error: "Cannot convert value of parameter 'Data' from 'System.String' to 'System.DateTime' ".
    I tried also to specify the format of date:
     <telerik:GridBoundColumn DataField="Data" DataType="System.DateTime"  


    HeaderText="Data" SortExpression="Data" UniqueName="Data" EditFormHeaderTextFormat="{0:dd/MM/yyyy HH:mm:ss}" DataFormatString="{0:dd/MM/yyyy HH:mm:ss}">





    or to use:




    telerik:GridDateTimeColumn DataField="Data" DataType="System.DateTime" HeaderText="Data" SortExpression="Data" UniqueName="Data" DataFormatString="{0:dd/MM/yyyy HH:mm:ss}" >









    I get always the same error, what can I do to solve?





  2. Pavlina
    Pavlina avatar
    6165 posts

    Posted 30 Apr 2010 Link to this post


    I assume that there is an issue with the parameters set in your Insert/Update methods. The links below show how to use ObjectDataSource with RadGrid
    Automatic operations with ObjectDataSource
    Automatic DataSource operations

    Best wishes,
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top