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

Binding to Nullable datetime returns blank column

2 Answers 61 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Aaron
Top achievements
Rank 1
Aaron asked on 22 Mar 2011, 03:39 AM
I've searched a few related threads but have not found a solution. I have upgraded to Q1 2011.

When I bind to a nullable datetime property the grid loads but the column values are blank.
Here is a column definition:

columns.Bound(o => o.StartDate.Value).Format(

 

"{0:dd MMMM yyyy}").Width(120).Title("Start Date"

);


EDIT: Also affects nullable decimal properties (I assume all nullables?):

columns.Template(o =>

 

 

String.Format("{0:C}", o.Amount.Value)).Width(100).Title("Dollar Value");

 


Is there a known solution to this?

Cheers
Aaron

 

 

2 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 22 Mar 2011, 09:21 AM
Hi Aaron,

 Our first look online demo is binding to nullable DateTime (OrderDate) and works as expected. You can check it out and see what is different in your case.

Regards,
Atanas Korchev
the Telerik team
0
Aaron
Top achievements
Rank 1
answered on 23 Mar 2011, 11:38 PM
Thanks for that.

I worked out my issue.After reviewing the demo you linked the issue was resolved by removing ".value" from the bound nullable property.

This solution worked for Q1 2011 but not for Q3 2010.

Cheers
Aaron
Tags
Grid
Asked by
Aaron
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Aaron
Top achievements
Rank 1
Share this question
or