protected override void OnRowChanged ( DataRowChangeEventArgs e )
{
base.OnRowChanged(e);
if ( e.Action == DataRowAction.Add )
{
if ( CollectionChanged != null )
{
CollectionChanged ( this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add) );
}
}
}
public event NotifyCollectionChangedEventHandler CollectionChanged;
Hello
Is there, somewhere in the doc or on Internet, examples of projects with the OutlookBar?
And, by the way, examples of the other rad tools?
Thanks
Richard
<telerik:GridViewComboBoxColumn Header="Status" x:Name="ctrlStatus" ItemsSource="{Binding Port}" DataMemberBinding="{Binding Status,Mode=TwoWay}" DisplayMemberPath="Status" Width="auto" IsFilterable="False" SelectedValueMemberPath="Status"> <telerik:GridViewComboBoxColumn.CellTemplate> <DataTemplate> <StackPanel> <telerik:RadComboBox x:Name="ctrlStatus" ItemsSource="{Binding Port}" DisplayMemberPath="Status" Width="auto" IsFilteringEnabled="False" SelectedValuePath="Status" SelectedValue="{Binding Status}"/> </StackPanel> </DataTemplate> </telerik:GridViewComboBoxColumn.CellTemplate></telerik:GridViewComboBoxColumn>Dear support team,
we're using your Chart control to display several charts in our WPF application and have massive problems with its performance. I'd like to describe the application design and hope you have an idea how we can improve the applications performance.
There is a TabControl with two tab items and in each of those are two charts. Only one chart is visible at any time, each chart contains two line series. The charts show measurement values which are reported every 100 milliseconds. These values are buffered and added to a ObservableCollection every second (actually just an implementation of IList and the notify interfaces to get the collection thread-safe). This collection is binded to the chart (MVVM). A measurement will take between one or two minutes, so there will be something around 1000 values for each chart.
You can find a screen shot of the application at http://dl.dropbox.com/u/36135015/telerik%20forum/chart%20performance/GuiScreen.png
At the beginning of a measurement switching tabs or the visibility in each tab is possible without any delays but the more values we're adding to the charts, the longer the delay is getting. After some time the application gets unusable as the UI thread is busy wile drawing(?) the chart. Important to mention: the target system is an embedded Windows 7 system with an Intel Atom CPU N270 (1,6GHz) and 1GB of RAM. Nevertheless, the delays can be noticed at our development system, too (Intel i5 2,67GHz, 8GB RAM).
We took some advices of the support center or common wpf advices like buffering values, changing the control template, using VirtualizingStackPanel but there's no remarkable difference.
Why is the chart getting so slow (in my opinion the drawing can't be that expensive) and are there other possibilities to fasten it up?
I made a small demo project that uses a tab control to show four charts and fill them with data each 100 milliseconds. You'll notice that after something around 20-30 seconds the tab item changes will get remarkable slower. You can find it here: http://dl.dropbox.com/u/36135015/telerik%20forum/chart%20performance/ChartPerformance.Demo.zip
Sincerly yours,
Matthias
public class Data : INotifyPropertyChanged { private double m_Value; private int m_Period; public event PropertyChangedEventHandler PropertyChanged; public double Value { get { return m_Value; } set { if (m_Value == value) return; m_Value = value; this.OnPropertyChanged("Value"); } } public int Period { get { return m_Period; } set { if (m_Period == value) return; m_Period = value; this.OnPropertyChanged("Period"); } } protected virtual void OnPropertyChanged(string propertyName) { if (this.PropertyChanged != null) this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } public class DataPointSeries : INotifyPropertyChanged { private ObservableCollection<Data> m_DataList; public ObservableCollection<Data> DataList { get { return m_DataList; } set { m_DataList = value; OnPropertyChanged("DataList"); } } public event PropertyChangedEventHandler PropertyChanged; protected virtual void OnPropertyChanged(string propertyName) { if (this.PropertyChanged != null) this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } }public class ChartsViewModel { private ObservableCollection<DataPointSeries> m_DataPointSeriesCollection; public ObservableCollection<DataPointSeries> DataPointSeriesCollection { get { return m_DataPointSeriesCollection; } set { m_DataPointSeriesCollection = value; } } public void PopulateDataSeriesCollection() { DataPointSeriesCollection = new ObservableCollection<DataPointSeries> { new DataPointSeries { DataList = GetDataPoint(0) }, new DataPointSeries { DataList = GetDataPoint(12.75) }, new DataPointSeries { DataList = GetDataPoint(27.625) }, new DataPointSeries { DataList = GetDataPoint(37.675) }, new DataPointSeries { DataList = GetDataPoint(43.475) } }; } public ObservableCollection<Data> GetDataPoint(double factor) { var dataList = new ObservableCollection<Data>() { new Data { Period = 2002, Value = 15 + factor }, new Data { Period = 2003, Value = 25 + factor }, new Data { Period = 2004, Value = 35 + factor }, new Data { Period = 2005, Value = 55 + factor }, new Data { Period = 2006, Value = 65 + factor }, new Data { Period = 2007, Value = 75 + factor } }; return dataList; } }