Hi !
I've got simple docking like this:
In code behind I'm trying to add new Pane to this PaneGroup:
But if I receive an Exception:
Exception does not appeart if I change the CanDockInDocumentHost property of new Pane to FALSE.
But I do want to have ability to dock new pane in DocumentHost.
Can someone show me the solution ?
I've got simple docking like this:
<
telerik:RadDocking
>
<
telerik:RadDocking.DocumentHost
>
<
telerik:RadSplitContainer
>
<
telerik:RadPaneGroup
x:Name
=
"MainPaneGroup"
>
<
telerik:RadPane
x:Name
=
"MainPane"
Header
=
"Main"
CanUserClose
=
"False"
>
<
Button
Content
=
"Add"
Width
=
"60"
Height
=
"20"
Click
=
"Button_Click"
/>
</
telerik:RadPane
>
</
telerik:RadPaneGroup
>
</
telerik:RadSplitContainer
>
</
telerik:RadDocking.DocumentHost
>
</
telerik:RadDocking
>
In code behind I'm trying to add new Pane to this PaneGroup:
RadPane newPane= new RadPane();
newPane.Title = "New pane";
newPane.Header = "New pane";
newPane.CanDockInDocumentHost = true;
newPane.Tag = "tag";
newPane.CanUserClose = true;
MainPaneGroup .Items.Add(newPane);
RadDocking.SetSerializationTag(newPane, "abc");
{System.NullReferenceException: Object reference not set to an instance of an object.
w Telerik.Windows.Controls.Docking.PaneGroupBase.OnPaneCommandCanExecute(Object sender, CanExecuteRoutedEventArgs e)
w Telerik.Windows.Controls.CommandBinding.OnCanExecute(Object sender, CanExecuteRoutedEventArgs e)
w Telerik.Windows.Controls.CommandManager.CanExecuteCommandBinding(Object sender, CanExecuteRoutedEventArgs e, CommandBinding commandBinding)
w Telerik.Windows.Controls.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
w Telerik.Windows.Controls.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
w Telerik.Windows.Controls.CommandManager.OnCanExecute(Object sender, CanExecuteRoutedEventArgs e)
w Telerik.Windows.Controls.CanExecuteRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)
w Telerik.Windows.RadRoutedEventArgs.InvokeHandler(Delegate handler, Object target)
w Telerik.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RadRoutedEventArgs routedEventArgs)
w Telerik.Windows.RouteItem.InvokeHandler(RadRoutedEventArgs routedEventArgs)
w Telerik.Windows.EventRoute.InvokeHandlersImpl(Object source, RadRoutedEventArgs args, Boolean raisedAgain)
w Telerik.Windows.EventRoute.InvokeHandlers(Object source, RadRoutedEventArgs args)
w Telerik.Windows.RadRoutedEventHelper.RaiseEvent(DependencyObject element, RadRoutedEventArgs args)
w Telerik.Windows.DependencyObjectExtensions.RaiseEvent(DependencyObject element, RadRoutedEventArgs e)
w Telerik.Windows.Controls.RoutedCommand.CanExecuteImpl(Object parameter, UIElement target, Boolean& continueRouting)
w Telerik.Windows.Controls.RoutedCommand.CanExecuteInternal(Object parameter, UIElement target, Boolean& continueRouting)
w Telerik.Windows.Controls.RoutedCommand.CanExecute(Object parameter, UIElement target)
w Telerik.Windows.Controls.RadMenuItem.CanExecuteApply()
w Telerik.Windows.Controls.RadMenuItem.OnCommandTargetChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
w Telerik.Windows.PropertyMetadata.PropertyChangeHook.OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
w System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
w System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
w System.Windows.DependencyObject.RefreshExpression(DependencyProperty dp)
w System.Windows.Data.BindingExpression.SendDataToTarget()
w System.Windows.Data.BindingExpression.SourceAcquired()
w System.Windows.Data.BindingExpression.System.Windows.IDataContextChangedListener.OnDataContextChanged(Object sender, DataContextChangedEventArgs e)
w System.Windows.Data.BindingExpression.DataContextChanged(Object sender, DataContextChangedEventArgs e)
w System.Windows.DataContextChangedEventHandler.Invoke(Object sender, DataContextChangedEventArgs e)
w System.Windows.FrameworkElement.OnDataContextChanged(DataContextChangedEventArgs e)
w System.Windows.FrameworkElement.OnAncestorDataContextChanged(DataContextChangedEventArgs e)
w System.Windows.FrameworkElement.NotifyDataContextChanged(DataContextChangedEventArgs e)
w System.Windows.FrameworkElement.OnPropertyChanged(DependencyProperty dp)
w System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
w System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
w System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet)
w System.Windows.FrameworkElement.set_DataContext(Object value)
w Telerik.Windows.Controls.RadPane.OnContextMenuTemplateChanged()
w Telerik.Windows.Controls.RadPane.OnContextMenuTemplateChanged(DependencyObject d, DependencyPropertyChangedEventArgs args)
w Telerik.Windows.PropertyMetadata.PropertyChangeHook.OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
w System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
w System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
w System.Windows.DependencyObject.InvalidateProperty(DependencyProperty property)
w MS.Internal.FrameworkCallbacks.InvalidateProperty(IntPtr nativeTarget, UInt32 propertyId)}
Exception does not appeart if I change the CanDockInDocumentHost property of new Pane to FALSE.
But I do want to have ability to dock new pane in DocumentHost.
Can someone show me the solution ?