I have a simple candlestick chart:
<telerik:RadChartName="radChart1"ItemsSource="{Binding ChartData}"Visibility="{Binding CandlestickVisibility}"><telerik:ChartDefaultView><telerik:ChartDefaultView.ChartLegend><telerik:ChartLegendIsEnabled="True"Visibility="Collapsed"/></telerik:ChartDefaultView.ChartLegend></telerik:ChartDefaultView><telerik:RadChart.SeriesMappings><telerik:SeriesMapping><telerik:SeriesMapping.SeriesDefinition><telerik:CandleStickSeriesDefinition/></telerik:SeriesMapping.SeriesDefinition><telerik:SeriesMapping.ItemMappings><telerik:ItemMappingDataPointMember="Open"FieldName="OpenPrice"/><telerik:ItemMappingDataPointMember="High"FieldName="HighPrice"/><telerik:ItemMappingDataPointMember="Low"FieldName="LowPrice"/><telerik:ItemMappingDataPointMember="Close"FieldName="ClosePrice"/></telerik:SeriesMapping.ItemMappings></telerik:SeriesMapping></telerik:RadChart.SeriesMappings></telerik:RadChart>
When I go into the designer and click the IsDateTime for the X Axis, I get a Microsoft .NET Framework exception: "Specified cast is not valid" with this callstack System.Windows.Markup.XamlParseException: Specified cast is not valid. ---> System.InvalidCastException: Specified cast is not valid.
at MS.Internal.Designer.PropertyEditing.Resources.ResourceUtilities.GetDouble(FrameworkElement element, String key, Double fallbackValue)
at MS.Internal.Designer.PropertyEditing.Resources.ResourceUtilities.GetDesiredTypeIconSize(FrameworkElement queryRoot)
at MS.Internal.Designer.PropertyEditing.Editors.SubPropertyEditor.RefreshQuickTypes()
at MS.Internal.Designer.PropertyEditing.Editors.SubPropertyEditor.RefreshVisuals()
at MS.Internal.Designer.PropertyEditing.Editors.SubPropertyEditor.OnPropertyEntryChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at MS.Internal.Designer.PropertyEditing.Editors.SubPropertyEditor.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.StyleHelper.ApplyTemplatedParentValue(DependencyObject container, FrameworkObject child, Int32 childIndex, FrugalStructList`1& childRecordFromChildIndex, DependencyProperty dp, FrameworkElementFactory templateRoot)
at System.Windows.StyleHelper.InvalidatePropertiesOnTemplateNode(DependencyObject container, FrameworkObject child, Int32 childIndex, FrugalStructList`1& childRecordFromChildIndex, Boolean isDetach, FrameworkElementFactory templateRoot)
at System.Windows.FrameworkTemplate.InvalidatePropertiesOnTemplate(DependencyObject container, Object currentObject)
at System.Windows.FrameworkTemplate.HandleBeforeProperties(Object createdObject, DependencyObject& rootObject, DependencyObject container, FrameworkElement feContainer, INameScope nameScope)
at System.Windows.FrameworkTemplate.<>c__DisplayClass6.<LoadOptimizedTemplateContent>b__3(Object sender, XamlObjectEventArgs args)
at System.Xaml.XamlObjectWriter.OnBeforeProperties(Object value)
at System.Xaml.XamlObjectWriter.Logic_CreateAndAssignToParentStart(ObjectWriterContext ctx)
at System.Xaml.XamlObjectWriter.WriteStartMember(XamlMember property)
at System.Xaml.XamlWriter.WriteNode(XamlReader reader)
at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter)
--- End of inner exception stack trace ---
at System.Windows.Markup.XamlReader.RewrapException(Exception e, Uri baseUri)
at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlReader templateReader, XamlObjectWriter currentWriter)
at System.Windows.FrameworkTemplate.LoadTemplateXaml(XamlObjectWriter objectWriter)
at System.Windows.FrameworkTemplate.LoadOptimizedTemplateContent(DependencyObject container, IComponentConnector componentConnector, IStyleConnector styleConnector, List`1 affectedChildren, UncommonField`1 templatedNonFeChildrenField)
at System.Windows.FrameworkTemplate.LoadContent(DependencyObject container, List`1 affectedChildren)
at System.Windows.StyleHelper.ApplyTemplateContent(UncommonField`1 dataField, DependencyObject container, FrameworkElementFactory templateRoot, Int32 lastChildIndex, HybridDictionary childIndexFromChildID, FrameworkTemplate frameworkTemplate)
at System.Windows.FrameworkTemplate.ApplyTemplateContent(UncommonField`1 templateDataField, FrameworkElement container)
at System.Windows.FrameworkElement.ApplyTemplate()
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.Controls.StackPanel.MeasureOverride(Size constraint)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.UIElement.UpdateLayout()
at System.Windows.Interop.HwndSource.SetLayoutSize()
at System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
at System.Windows.Interop.HwndSource.set_RootVisual(Visual value)
at System.Windows.Forms.Integration.ElementHost.OnHandleCreated(EventArgs e)
at System.Windows.Forms.Control.WmCreate(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Integration.ElementHost.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
How do I make the X Axis a datetime without blowing out the designer?