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

RadGrid and ObjectDataSource issue

1 Answer 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
archimede
Top achievements
Rank 1
archimede asked on 28 Apr 2010, 08:40 AM
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}">

 

 

 

</telerik:GridBoundColumn>

or to use:

<

 

 

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

 

 

 

 

</telerik:GridDateTimeColumn>

 

 

 

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

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 30 Apr 2010, 03:12 PM
Hello,

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,
Pavlina
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.
Tags
Grid
Asked by
archimede
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or