or
private static PropertyDescriptorCollection GetPropertyDescriptors(QueryableCollectionView collectionView){...if (TypeExtensions.IsCompatibleWith(elementType, typeof (ICustomTypeDescriptor))) //code pass return ItemPropertyInfoHelper.GetPropertyDescriptorsForCustomTypeDescriptorElementType(collectionView);...}public static PropertyDescriptorCollection GetPropertyDescriptorsForCustomTypeDescriptorElementType(QueryableCollectionView collectionView) { var customTypeDescriptor = ItemPropertyInfoHelper.GetCollectionViewRepresentativeItem(collectionView) as ICustomTypeDescriptor; //returns null if (customTypeDescriptor != null) return customTypeDescriptor.GetProperties(); //Never called when ItemsSource is not set else return null; }private static object GetCollectionViewRepresentativeItem(QueryableCollectionView collectionView) { if (!collectionView.IsEmpty) return collectionView.GetItemAt(0); //collection is empty else return null; }<telerik:RadGridView.InputBindings>
<KeyBinding Key="A" Modifiers="Ctrl" Command="{Binding MyCommand}" />
</telerik:RadGridView.InputBindings>namespace TimelineTest{ public partial class MainWindow : Window { private List<Item> items = new List<Item>(); public MainWindow() { InitializeComponent(); items.Add(new Item() { Date = new DateTime(2014, 5, 5), Duration = TimeSpan.FromHours(5) }); items.Add(new Item() { Date = new DateTime(2014, 5, 5, 14, 18, 22), Duration = TimeSpan.FromHours(5) }); timeline.ItemsSource = items; } public class Item { public TimeSpan Duration { get; set; } public DateTime Date { get; set; } } private void Button_Click(object sender, RoutedEventArgs e) { DateTime now = DateTime.Now; timebar.PeriodStart = new DateTime(now.Year, now.Month, now.Day, 0, 0, 0); timebar.PeriodEnd = new DateTime(now.Year, now.Month, now.Day, 23, 59, 59); } }}<Window x:Class="TimelineTest.MainWindow" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" Title="MainWindow" Height="350" Width="525"> <Grid> <telerik:RadTimeBar Name="timebar" Height="64" Margin="10,0,10,193" PeriodStart="5/5/2014 00:00:00" PeriodEnd="05/5/2014 23:59:59" VerticalAlignment="Bottom" MaxSelectionRange="0:0:10" MinSelectionRange="0:0:10" SelectionTitleFormatString="{}{0:MM-dd-yy HH:mm:ss}"> <telerik:RadTimeBar.Intervals> <telerik:HourInterval IntervalSpans="1,4"/> <telerik:MinuteInterval IntervalSpans="1,5,15,30"/> </telerik:RadTimeBar.Intervals> <telerik:RadTimeBar.Content> <telerik:RadTimeline Name="timeline" Margin="0, -65, 0, 0" PeriodStart="{Binding PeriodStart, ElementName=timebar}" PeriodEnd="{Binding PeriodEnd, ElementName=timebar}" telerik:StyleManager.Theme="Windows8Touch" StartPath="Date" DurationPath="Duration" ScrollMode="None"> <telerik:RadTimeline.Intervals> <telerik:DayInterval IntervalSpans="1"/> </telerik:RadTimeline.Intervals> </telerik:RadTimeline> </telerik:RadTimeBar.Content> </telerik:RadTimeBar> <Button Content="Button" HorizontalAlignment="Left" Margin="125,230,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click"/> </Grid></Window>