or
<Window xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" x:Class="WpfApplication1.MainWindow" x:Name="Window" Title="MainWindow"> <Window.Resources> <DataTemplate x:Key="InstantItemTemplate"> <Rectangle Width="7" Height="{Binding ElementName=slider1, Path=Value}" Fill="Red" /> </DataTemplate> <DataTemplate x:Key="ItemWithDurationTemplate"> <Rectangle Margin="0, 0, 0, 5" Height="20" VerticalAlignment="Center" Fill="Green"/> </DataTemplate> </Window.Resources> <DockPanel LastChildFill="True"> <StackPanel DockPanel.Dock="Top"> <StackPanel Orientation="Horizontal"> <Slider Minimum="1" Maximum="1500" Value="{Binding ElementName=sliderTextBox, Path=Text, Mode=TwoWay}" TickFrequency="1" Name="slider1" Width="600" /> <TextBox Name="sliderTextBox" Text="{Binding ElementName=slider1, Path=Value}" /> </StackPanel> <TextBlock Text="{Binding ElementName=slider1, Path=Value}" FontSize="20" FontWeight="Bold" Height="25" HorizontalAlignment="Center" /> </StackPanel> <telerik:RadTimeline x:Name="timeline" Margin="6" VerticalAlignment="Top" PeriodStart="2011/01/01" PeriodEnd="2011/06/01" VisiblePeriodStart="2011/01/01" VisiblePeriodEnd="2011/03/22" StartPath="Date" DurationPath="Duration" VerticalScrollBarVisibility="Auto" TimelineItemTemplate="{StaticResource ItemWithDurationTemplate}" TimelineInstantItemTemplate="{StaticResource InstantItemTemplate}"> <telerik:RadTimeline.Intervals> <telerik:DayInterval /> <telerik:WeekInterval /> <telerik:MonthInterval /> <telerik:YearInterval /> </telerik:RadTimeline.Intervals> </telerik:RadTimeline> </DockPanel></Window>
CS
using System;
using System.Collections.Generic;
using System.Windows;
namespace WpfApplication1
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
private List<Item> dataSource;
private DateTime startDate;
public MainWindow()
{
InitializeComponent();
dataSource = new List<Item>();
startDate = new DateTime(2011, 1, 1);
var endDate = new DateTime(2011, 6, 1);
Random r = new Random();
for (DateTime i = startDate; i < endDate; i = i.AddMonths(1))
{
for (int j = 0; j < 20; j++)
dataSource.Add(new Item() { Date = i, Duration = TimeSpan.FromDays(r.Next(50, 100)) });
}
dataSource.Add(new Item() { Date = startDate.AddMonths(3).AddDays(15) });
timeline.ItemsSource = dataSource;
timeline.VisiblePeriodStart = startDate.AddDays(20);
timeline.VisiblePeriodEnd = endDate.AddDays(-20);
}
}
public class Item
{
public TimeSpan Duration { get; set; }
public DateTime Date { get; set; }
}
}
Hi,
We noticed that the export to pdf function do not realy generate a good pdf files.
In fact we use the export function to generate pdf files, then these pdf files should be indexed to simplify our search function.
But when we try to index the pdf file generated by the RadDocument, we have an exception because the the pdf files is corrupted
and we try to open the file by Adobe Reader, it opened as modified file.

public partial class SystemStatusChart : UserControl { public SystemStatusChart() { InitializeComponent(); vm = new SystemStatusChartViewModel(); DataContext = vm; MainWindow.CloseDataContext += MainWindow_CloseDataContext; } void MainWindow_CloseDataContext() { vm = (SystemStatusChartViewModel)DataContext; if (vm != null) { vm.RefreshTimer.Stop(); vm = null; DataContext = null; } } private SystemStatusChartViewModel vm; }
class SystemStatusChartViewModel : ViewModelBase { public Timer RefreshTimer; public SystemStatusChartViewModel() { RefreshTimer = new Timer(); RefreshTimer.Elapsed += DataService; RefreshTimer.Interval = 1000; RefreshTimer.Enabled = true; } public async void DataService(object o, EventArgs e) {RefreshTimer.Stop();//Capture Data, error checking, logging StatusData = temp1; //update data ForecastData = temp2; //update dataRefreshTimer.Start(); } /// <summary> /// The <see cref="StatusData" /> property's name. /// </summary> public const string StatusDataPropertyName = "StatusData"; private RadObservableCollection<StatusChartItem> _statusData = new RadObservableCollection<StatusChartItem>(); /// <summary> /// Sets and gets the StatusData property. /// Changes to that property's value raise the PropertyChanged event. /// </summary> public RadObservableCollection<StatusChartItem> StatusData { get { return _statusData; } set { if (_statusData == value) { return; } RaisePropertyChanging(StatusDataPropertyName); _statusData = value; LastUpdate = new ObservableCollection<DateTime>() { DateTime.Now }; FirstUpdate = new ObservableCollection<DateTime>() { DateTime.Now.AddDays(-2) }; RaisePropertyChanged(StatusDataPropertyName); } } /// <summary> /// The <see cref="ForecastData" /> property's name. /// </summary> public const string ForecastDataPropertyName = "ForecastData"; private RadObservableCollection<StatusChartItem> _forecastDataList = new RadObservableCollection<StatusChartItem>(); /// <summary> /// Sets and gets the "ForecastData property. /// Changes to that property's value raise the PropertyChanged event. /// </summary> public RadObservableCollection<StatusChartItem> ForecastData { get { return _forecastDataList; } set { if (_forecastDataList == value) { return; } RaisePropertyChanging(ForecastDataPropertyName); _forecastDataList = value; RaisePropertyChanged(ForecastDataPropertyName); } }