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

ChartMonthGroupDescriptor throws error when member is Nullable<DateTime>

1 Answer 41 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Novella
Top achievements
Rank 1
Novella asked on 10 May 2011, 07:35 PM
Just like it says, every ChartGroupDescriptor for grouping by Month,Year etc. Throws a Object Reference error when you set the member to a Nullable<DateTime>.  Upgraded to Q1, which I though was suppose to support this stuff, but no luck.

Is there any documentation on creating my own ChartGroupDescriptor so I can fix this?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 12 May 2011, 12:32 PM
Hello Novella,

The Empty Values support introduced with the Q1 2011 release concerns the visualization of the plotted numeric YValue and it behaves as expected.

That said, we must confirm that currently the DateTime-specific group descriptors (ChartMonthGroupDescriptor, ChartYearGroupDecriptor, etc.) do not work properly if the field type is Nullable<DateTime>. We have logged your report in our public issue tracking system and will forward it to our developers for further consideration.

As a workaround we would suggest you to use the plain ChartGroupDescriptor instead e.g. if you wanted to use ChartMonthGroupDescriptor, you can achieve the same effect by exposing the Month field of the Nullable<DateTime> as a Nullable<int> read-only property on your business object, and then you will be able to properly group by the newly created integer field.

See the attached sample application that demonstrates this approach (note that it uses custom format converter for the axis labels in order to handle the NULL group case that would otherwise be visualized as "Dec 1899").

Hope this helps. We have updated your Telerik points for the report as well.


Greetings,
Giuseppe
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
Chart
Asked by
Novella
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Share this question
or