I'm trying to set the data type of one of my columns with code behind using the following code but it is erroring
Can anyone explain what i'm doing wrong?
column.DataType = typeof(DateTime);
3 Answers, 1 is accepted
0
Yavor Georgiev
Telerik team
answered on 27 May 2010, 01:04 PM
Hello Cameron Molyneux,
Could you share a bit more information about your scenario? What is the incoming data's type, what is the error you're getting, etc.
Sincerely yours,
Yavor Georgiev
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.
we call a service and get a dataset returned .. all the columns are typed as string
i was hoping that the string would automatically cast as a date if we typed the column as a date
the date format is 27/05/2010 for example
the issue i'm having is when we try and sort by the column .. as it is it doesnt sort as a date would
0
Vlad
Telerik team
answered on 27 May 2010, 01:28 PM
Hello,
Casting one type to other will not convert anything. You need to create DateTime from this string to achieve your goal.
Kind regards,
Vlad
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.