namespace RadGridViewFocusBug |
{ |
/// <summary> |
/// Interaction logic for Window1.xaml |
/// </summary> |
public partial class Window1 : Window |
{ |
public Window1() |
{ |
InitializeComponent(); |
ObservableCollection<BusinessObject> col = new ObservableCollection<BusinessObject>(); |
col.Add(new BusinessObject() { Arrival = DateTime.Now }); |
col.Add(new BusinessObject() { Arrival = DateTime.Now }); |
col.Add(new BusinessObject() { Arrival = DateTime.Now }); |
this.DataContext = col; |
} |
} |
public class BusinessObject |
{ |
public DateTime Arrival { get; set; } |
} |
} |
<Window x:Class="RadGridViewFocusBug.Window1" |
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="Window1" Height="300" Width="300"> |
<Grid> |
<telerik:RadGridView ItemsSource="{Binding}" AutoGenerateColumns="False"> |
<telerik:RadGridView.Columns> |
<telerik:GridViewDataColumn Header="Arrival" > |
<telerik:GridViewColumn.CellTemplate> |
<DataTemplate> |
<telerik:DateTimePicker SelectedDateTime="{Binding Path=Arrival, Mode=TwoWay}"/> |
</DataTemplate> |
</telerik:GridViewColumn.CellTemplate> |
</telerik:GridViewDataColumn> |
</telerik:RadGridView.Columns> |
</telerik:RadGridView> |
</Grid> |
</Window> |
Object reference not set to an instance of an object.
at Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.FindRootVisual() at Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.Initialize() at Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.OnAllowDragChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e) at System.Windows.FrameworkElement.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, OperationType operationType) at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal) at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value) at Telerik.Windows.Controls.DragDrop.RadDragAndDropManager.SetAllowDrag(DependencyObject obj, Boolean value) at Telerik.Windows.Controls.RadTileViewItem.OnApplyTemplate() at System.Windows.FrameworkElement.ApplyTemplate() at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Canvas.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ItemsPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Control.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Border.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Control.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Designer.SimpleViewManager.DesignerBackground.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Decorator.MeasureOverride(Size constraint) at Microsoft.Windows.Design.Interaction.DesignerView.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Designer.Viewport.MeasureOverride(Size availableSize) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ScrollContentPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.ScrollViewer.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Grid.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at MS.Internal.Helper.MeasureElementWithSingleChild(UIElement element, Size constraint) at System.Windows.Controls.ContentPresenter.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) at System.Windows.Controls.Control.MeasureOverride(Size constraint) at System.Windows.FrameworkElement.MeasureCore(Size availableSize) at System.Windows.UIElement.Measure(Size availableSize) 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 MS.Internal.Designer.VSIsolatedDesigner.ViewHolder.Initialize() at MS.Internal.Designer.VSIsolatedDesigner.ViewHolder..ctor(UIElement content) at MS.Internal.Designer.VSIsolatedDesigner.VSIsolatedView.get_ViewHandle() at MS.Internal.Host.Isolation.IsolatedView.get_ViewHandle() at MS.Internal.Designer.DesignerPane.LoadDesignerView()
My TileView's XAML is this:
<NavigationControls:RadTileView Grid.ColumnSpan="4" Name="radTileView1" Grid.Row="1" |
Margin="5" Width="800" Height="450" MinimizedColumnWidth="150"> |
<NavigationControls:RadTileViewItem> |
<NavigationControls:RadTileViewItem.Header> |
<TextBlock Text="VehÃculo header"></TextBlock> |
</NavigationControls:RadTileViewItem.Header> |
<NavigationControls:RadTileViewItem.Content> |
<Controls:RadFluidContentControl AnimationControls:AnimationManager.IsAnimationEnabled="True" |
SmallToNormalThreshold="291,130" |
NormalToSmallThreshold="292,131" |
NormalToLargeThreshold="735,350" |
LargeToNormalThreshold="731,351"> |
<Controls:RadFluidContentControl.SmallContent> |
<TextBlock Text="VehÃculo small"></TextBlock> |
</Controls:RadFluidContentControl.SmallContent> |
<Controls:RadFluidContentControl.Content> |
<TextBlock Text="VehÃculo content"></TextBlock> |
</Controls:RadFluidContentControl.Content> |
<Controls:RadFluidContentControl.LargeContent> |
<TextBlock Text="VehÃculo large"></TextBlock> |
</Controls:RadFluidContentControl.LargeContent> |
</Controls:RadFluidContentControl> |
</NavigationControls:RadTileViewItem.Content> |
</NavigationControls:RadTileViewItem> |
<NavigationControls:RadTileViewItem> |
<NavigationControls:RadTileViewItem.Header> |
<TextBlock Text="Empresa header"></TextBlock> |
</NavigationControls:RadTileViewItem.Header> |
<NavigationControls:RadTileViewItem.Content> |
<Controls:RadFluidContentControl AnimationControls:AnimationManager.IsAnimationEnabled="True" |
SmallToNormalThreshold="291,130" |
NormalToSmallThreshold="292,131" |
NormalToLargeThreshold="735,350" |
LargeToNormalThreshold="731,351"> |
<Controls:RadFluidContentControl.SmallContent> |
<TextBlock Text="Empresa small"></TextBlock> |
</Controls:RadFluidContentControl.SmallContent> |
<Controls:RadFluidContentControl.Content> |
<TextBlock Text="Empresa content"></TextBlock> |
</Controls:RadFluidContentControl.Content> |
<Controls:RadFluidContentControl.LargeContent> |
<TextBlock Text="Empresa large"></TextBlock> |
</Controls:RadFluidContentControl.LargeContent> |
</Controls:RadFluidContentControl> |
</NavigationControls:RadTileViewItem.Content> |
</NavigationControls:RadTileViewItem> |
</NavigationControls:RadTileView> |
private void RadTreeView_DragEnded(object sender, Telerik.Windows.Controls.RadTreeViewDragEndedEventArgs e) |
{ |
object droppedTopics = e.DraggedItems; |
object targetDropItem = e.TargetDropItem; |
Model.Topic targetTopic = targetDropItem as Model.Topic; |
foreach (object droppedTopic in e.DraggedItems as Collection<object>) |
{ |
Model.Topic sourceTopic = droppedTopic as Model.Topic; |
targetTopic.ParentTopicId = sourceTopic.ID; |
} |
} |
The problem is that after the following line, targetTopic is always null.
Model.Topic targetTopic = targetDropItem as Model.Topic; |