Hi
I would very much appreciate some help on the following problem:
I have a project in which I have a RadChart. Upon starting my application the RadChart is populated with 3 data series (Car, Property and Travel) in a stacked bar format. User can then click on any of the 12 resulting ChartItems, in which case the chart is repopulated by a new DataSeries, this time in a line format. (Basically it is based on Telerik's Drill Down demo - the first chart displays sales per month, the second chart breaks it further into days.)
To return from the second view back to the first view, user clicks the Reload button, which runs the same method (ConfigureMonthlyRevenue()) that was run upon starting the application.
There were no problems with this code until I upgraded to Q2 yesterday. Now all runs smoothly until I hit the Reload button and the application hangs. When I pause it, I get the "Cannot evaluate expression because the code of the current method is optimized" error when hovering over the bit of code where I'm adding the series to the chart. Please see the code snippet below:
//This is the bit that's run upon starting the app (without problems) and then when the Reload button is hit (which is when it hangs on the bold line)
private void ConfigureMonthlyRevenue()
{
this.past12Months.DefaultView.ChartArea.DataSeries.Clear();
this.past12Months.DefaultView.ChartTitle.Content = "Past 12 Months Revenue";
DataSeries seriesCar = new DataSeries();
seriesCar.Definition = new StackedBarSeriesDefinition();
seriesCar.LegendLabel = "Car";
seriesCar.Definition.ShowItemToolTips = true;
DataSeries seriesProperty = new DataSeries();
seriesProperty.Definition = new StackedBarSeriesDefinition();
seriesProperty.LegendLabel = "Property";
seriesProperty.Definition.ShowItemToolTips = true;
DataSeries seriesTravel = new DataSeries();
seriesTravel.Definition = new StackedBarSeriesDefinition();
seriesTravel.LegendLabel = "Travel";
seriesTravel.Definition.ShowItemToolTips = true;
this.FillWithRevenueData(seriesCar, seriesProperty, seriesTravel);
chartArea.DataSeries.Add(seriesCar);
chartArea.DataSeries.Add(seriesProperty);
chartArea.DataSeries.Add(seriesTravel);
chartArea.AxisX.StripLinesVisibility = Visibility.Collapsed;
chartArea.AxisY.Title = "(thousand dollars)";
chartArea.AxisX.TickPoints.Clear();
chartArea.AxisY.Step = 100d;
chartArea.AxisY.DefaultFormat = "C0";
string[] months = new string[] { "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Jan", "Feb", "Mar", "Apr", "May", "Jun" };
for (int i = 0; i < months.Length; i++)
{
chartArea.AxisX.TickPoints.Add(new TickPoint());
chartArea.AxisX.TickPoints[i].Label = months[i];
}
}
//When chartItem clicked
private void chartArea_ChartItemClick(object sender, ChartItemClickEventArgs e)
{
this.past12Months.DefaultView.ChartArea.ChartItemClick -= this.chartArea_ChartItemClick;
string axisItemLabel = past12Months.DefaultView.ChartArea.AxisX.TickPoints[e.ItemIndex].Label;
string product = e.DataSeries.LegendLabel.ToString();
past12Months.DefaultView.ChartTitle.Content = string.Format("Daily Revenue {0} ({1})", product, axisItemLabel);
DataSeries series = new DataSeries();
series.Definition = new LineSeriesDefinition();
series.LegendLabel = "Daily Revenue";
FillWithDailyDummyData(series);
past12Months.DefaultView.ChartArea.DataSeries.Clear();
past12Months.DefaultView.ChartArea.DataSeries.Add(series);
string[] days = new string[] { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30" };
for (int i = 0; i < days.Length; i++)
{
past12Months.DefaultView.ChartArea.AxisX.TickPoints[i].Label = days[i];
}
this.past12Months.DefaultView.ChartArea.ChartItemClick += this.chartArea_ChartItemClick;
}
Any help with this would be much appreciated.
Thank you
Judi
| private void GroupDescriptions_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) |
| { |
| if (recordings.GroupDescriptions.Count > 0) |
| { |
| foreach (RadGroupDescription rgd in recordings.GroupDescriptions) |
| { |
| CountFunction cf = new CountFunction(rgd.PropertyName, rgd.PropertyName, ""); |
| rgd.AggregateFunctions.Add(cf); |
| } |
| } |
| } |

| <telerik:GridViewDataColumn |
| HeaderText="First Name" |
| IsCustomSortingEnabled="False" |
| IsFilterable="False" |
| DataMemberPath="Data.FirstName" /> |
| <telerik:GridViewDataColumn |
| HeaderText="Default Value" |
| UniqueName="Default" |
| IsSortable="True"> |
| <telerik:GridViewColumn.CellTemplate> |
| <DataTemplate> |
| <CheckBox |
| VerticalAlignment="Center" |
| IsChecked="{Binding Path=IsDefault}" |
| /> |
| </DataTemplate> |
| </telerik:GridViewColumn.CellTemplate> |
| </telerik:GridViewDataColumn> |


Hi
I've done quite a lot of WinForm stuff but I'm juist getting into WPF.
I have been experimenting with the simple thermometer demonstration on your website at:
http://www.telerik.com/help/wpf/linear-gauge-create-thermometer.html
And I'm getting the following error:
"The type reference cannot find a public type named 'MajorTickProperties'."
on:
<Style x:Key="ScaleMajorTick" TargetType="{x:Type telerik:MajorTickProperties}">
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I'm guessing it's a reference/namespace issue but I'm referencing Telerik.Windows.Controls and Telerik.Windows.Controls.Gauge.
And I'm including xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" in the Window declaration.
<Window x:Class="Thermometer.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
Title="MainWindow" Height="400" Width="400">
The rest of the code is here:
<Window x:Class="Thermometer.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
Title="MainWindow" Height="400" Width="400">
<Window.Resources>
<Style x:Key="CommonScaleStyle" TargetType="{x:Type telerik:LinearScale}">
<Setter Property="Top" Value="0.05" />
<Setter Property="StartWidth" Value="0.05" />
<Setter Property="EndWidth" Value="0.05" />
<Setter Property="MiddleTicks" Value="1" />
<Setter Property="MinorTicks" Value="5" />
<Setter Property="BorderBrush" Value="Transparent" />
</Style>
<Style x:Key="ScaleMajorTick" TargetType="{x:Type telerik:MajorTickProperties}">
<Setter Property="Length" Value="0.03" />
<Setter Property="TickWidth" Value="0.2" />
</Style>
<Style x:Key="ScaleMinorTick" TargetType="{x:Type telerik:MajorTickProperties}">
<Setter Property="Length" Value="0.02" />
<Setter Property="TickWidth" Value="0.15" />
</Style>
<Style x:Key="ScaleLabel" TargetType="{x:Type telerik:MajorLabelProperties}">
<Setter Property="Offset" Value="0.03" />
</Style>
<Style x:Key="ThermometerBarStyle" TargetType="{x:Type telerik:LinearBar}">
<Setter Property="StrokeThickness" Value="0" />
<Setter Property="IsAnimated" Value="True" />
<Setter Property="EmptyFill" Value="Transparent" />
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="-0.0263883,0.499995" EndPoint="1.01428,0.499995">
<GradientStop Color="#FFFEFFFE" Offset="0"/>
<GradientStop Color="#FFFEFFFE" Offset="0.5"/>
<GradientStop Color="#FFD8DADB" Offset="0.501"/>
<GradientStop Color="#FFB2B5B7" Offset="1"/>
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="StartWidth" Value="0.013"/>
<Setter Property="EndWidth" Value="0.013"/>
</Style>
<DataTemplate x:Key="TickLabelEmpty" />
<Style x:Key="BulbStyle" TargetType="{x:Type telerik:CustomTickMark}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<ContentPresenter>
<ContentPresenter.Content>
<Grid Margin="-5,0,-5,24" Width="100">
<Grid Margin="39.5,1,39.5,0">
<Ellipse Stretch="Fill" Height="21" Fill="#FF720700" Margin="0,0,0,0" VerticalAlignment="Bottom" Opacity="0.5"/>
<Border CornerRadius="6,6,6,6" BorderBrush="#FF720700" BorderThickness="2,2,2,2" Margin="3,0,3,2" Width="12" Opacity="0.5">
<Border.Background>
<LinearGradientBrush StartPoint="0.5,0.955317" EndPoint="0.5,0.00861141">
<GradientStop Color="#FF5A0400" Offset="0"/>
<GradientStop Color="#FF900C00" Offset="1"/>
</LinearGradientBrush>
</Border.Background>
</Border>
<Border Margin="6.5,1,6.5,3" CornerRadius="5,5,5,5" BorderBrush="#FFFF6D00" BorderThickness="1,1,1,1" Background="{x:Null}" VerticalAlignment="Stretch"/>
<Ellipse Stretch="Fill" Height="17" VerticalAlignment="Bottom" Stroke="#FFFF6D00" Margin="2,0,2,2" x:Name="redEllipse">
<Ellipse.Fill>
<RadialGradientBrush>
<GradientStop Offset="0" Color="#FF720700" />
</RadialGradientBrush>
</Ellipse.Fill>
</Ellipse>
<Border Margin="7.5,2,7.5,4" CornerRadius="4,4,4,4" BorderBrush="#FF720700" BorderThickness="1,1,1,1">
<Border.Background>
<LinearGradientBrush StartPoint="0.5,0.955317" EndPoint="0.5,0.00861141">
<GradientStop Color="#FF5A0400" Offset="0"/>
<GradientStop Color="#FF900C00" Offset="1"/>
</LinearGradientBrush>
</Border.Background>
</Border>
<Border Margin="8.5,220,8.5,9" CornerRadius="3,3,3,3">
<Border.Background>
<LinearGradientBrush StartPoint="-0.0263883,0.499995" EndPoint="1.01428,0.499995">
<GradientStop Color="#FFFEFFFE" Offset="0"/>
<GradientStop Color="#FFFEFFFE" Offset="0.5"/>
<GradientStop Color="#FFD8DADB" Offset="0.501"/>
<GradientStop Color="#FFB2B5B7" Offset="1"/>
</LinearGradientBrush>
</Border.Background>
</Border>
<Ellipse Stretch="Fill" Height="13" Margin="4,0,4,4" VerticalAlignment="Bottom">
<Ellipse.Fill>
<LinearGradientBrush StartPoint="-0.0263883,0.499995" EndPoint="1.01428,0.499995">
<GradientStop Color="#FFFEFFFE" Offset="0"/>
<GradientStop Color="#FFFEFFFE" Offset="0.50"/>
<GradientStop Color="#FFD8DADB" Offset="0.501"/>
<GradientStop Color="#FFB2B5B7" Offset="1"/>
</LinearGradientBrush>
</Ellipse.Fill>
</Ellipse>
</Grid>
</Grid>
</ContentPresenter.Content>
</ContentPresenter>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="ItemTemplate" Value="{StaticResource TickLabelEmpty}" />
<Setter Property="Length" Value="1" />
<Setter Property="Offset" Value="0" />
<Setter Property="TickWidth" Value="1" />
<Setter Property="Type" Value="Custom" />
</Style>
</Window.Resources>
<Grid Width="150" Height="300">
<telerik:RadGauge>
<telerik:LinearGauge>
<telerik:LinearScale Name="Celsius" Max="40" Min="-30" MajorTicks="7" Style="{StaticResource CommonScaleStyle}">
<telerik:LinearScale.MajorTick>
<telerik:TickProperties Style="{StaticResource ScaleMajorTick}" Location="Outside" />
</telerik:LinearScale.MajorTick>
<telerik:LinearScale.MinorTick>
<telerik:TickProperties Style="{StaticResource ScaleMinorTick}" Location="Outside" />
</telerik:LinearScale.MinorTick>
<telerik:LinearScale.Label>
<telerik:LabelProperties Style="{StaticResource ScaleLabel}" Location="Outside"/>
</telerik:LinearScale.Label>
<telerik:TickList>
<telerik:CustomTickMark Value="-2" Style="{StaticResource BulbStyle}" Location="OverCenter"/>
<telerik:CustomTickMark Style="{StaticResource EmptyShapeCustomTick}" Value="-37">
<telerik:CustomTickMark.ItemTemplate>
<DataTemplate>
<TextBlock>C°</TextBlock>
</DataTemplate>
</telerik:CustomTickMark.ItemTemplate>
</telerik:CustomTickMark>
</telerik:TickList>
<telerik:IndicatorList>
<telerik:LinearBar Style="{StaticResource ThermometerBarStyle}" Value="5"/>
</telerik:IndicatorList>
</telerik:LinearScale>
<telerik:LinearScale Name="Fahrenheit" Max="104" Min="-22" MajorTicks="6" StartTickOffset="2" EndTickOffset="-4" Style="{StaticResource CommonScaleStyle}">
<telerik:LinearScale.MajorTick>
<telerik:TickProperties Style="{StaticResource ScaleMajorTick}" Location="Inside" />
</telerik:LinearScale.MajorTick>
<telerik:LinearScale.MinorTick>
<telerik:TickProperties Style="{StaticResource ScaleMinorTick}" Location="Inside" />
</telerik:LinearScale.MinorTick>
<telerik:LinearScale.Label>
<telerik:LabelProperties Style="{StaticResource ScaleLabel}" Location="Inside"/>
</telerik:LinearScale.Label>
<telerik:TickList>
<telerik:CustomTickMark Style="{StaticResource EmptyShapeCustomTick}" Location="Inside" Value="-34.5">
<telerik:CustomTickMark.ItemTemplate>
<DataTemplate>
<TextBlock>F°</TextBlock>
</DataTemplate>
</telerik:CustomTickMark.ItemTemplate>
</telerik:CustomTickMark>
</telerik:TickList>
</telerik:LinearScale>
</telerik:LinearGauge>
</telerik:RadGauge>
</Grid>
</Window>
Hope someone can suggest something?
Regards
Rob
| <telerik:RadGridView Name="radGridView1" AutoGenerateColumns="False"> |
| <telerik:RadGridView.Columns> |
| <telerik:GridViewDataColumn HeaderText="Name" UniqueName="Name" /> |
| <telerik:GridViewDataColumn HeaderText="Testabc 1" DataMemberPath="Test1"/> |
| <telerik:GridViewDataColumn HeaderText="Testabc 2" DataMemberPath="Test2"/> |
| <telerik:GridViewDataColumn HeaderText="Testabc 3" DataMemberPath="Test3"/> |
| </telerik:RadGridView.Columns> |
| </telerik:RadGridView> |