IsPinned Bug...

8 posts, 0 answers
  1. Casey
    Casey avatar
    27 posts
    Member since:
    May 2009

    Posted 29 Sep 2009 Link to this post

    I have a Pane that i am Pinning and UnPinning programatically.


    Step 1. set isPinned = true;
    Step 2. set isPinned = false;
    Step 3. set isPinned = true;

    The first few times it works... but then it crashes..  The first information below is the error.. After this, I have included the results from the VS Watch window which shows that the RadPane looks the same when it crashes as it does when it doesn't


    Here is the error message...System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Value does not fall within the expected range. 
     at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
       at MS.Internal.XcpImports.Collection_AddValue[T](PresentationFrameworkCollection`1 collection, CValue value)
       at MS.Internal.XcpImports.Collection_AddDependencyObject[T](PresentationFrameworkCollection`1 collection, DependencyObject value)
       at System.Windows.PresentationFrameworkCollection`1.AddDependencyObject(DependencyObject value)
       at System.Windows.Controls.UIElementCollection.AddInternal(UIElement value)
       at System.Windows.PresentationFrameworkCollection`1.Add(T value)
       at System.Windows.Controls.ItemsControl.AddVisualChild(Int32 index, DependencyObject container, Boolean needPrepareContainer)
       at System.Windows.Controls.ItemsControl.AddContainerForPosition(GeneratorPosition position)
      at System.Windows.Controls.ItemsControl.OnIte
    msChangedHandler(Object sender, ItemsChangedEventArgs args)
       at System.Windows.Controls.Primitives.ItemsChangedEventHandler.Invoke(Object sender, ItemsChangedEventArgs e)
       at System.Windows.Controls.ItemContainerGenerator.OnItemAdded(Object item, Int32 index)
       at System.Windows.Controls.ItemContainerGenerator.System.Windows.Controls.ICollectionChangedListener.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
       at System.Windows.Controls.WeakCollectionChangedListener.SourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
       at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
       at System.Windows.Controls.ItemCollection.NotifyCollectionChanged(NotifyCollectionChangedEventArgs e)
       at System.Windows.Controls.ItemCollection.InsertImpl(Int32 index, Object value)
       at System.Windows.Controls.ItemCollection.InsertInternal(Int32 index, Object value)
       at System.Wi
    ndows.PresentationFrameworkCollection`1.Insert(Int32 index, T value)
       at Telerik.Windows.Controls.RadPaneGroup.PinPane(RadPane pane)
       at Telerik.Windows.Controls.Docking.AutoHideArea.PinPane(RadPane pane)
       at Telerik.Windows.Controls.RadDocking.PinPane(RadPane radPane, AutoHideArea area, Boolean stopEvents)
       at Telerik.Windows.Controls.RadDocking.RadPane_PinChange(Object sender, PinChangeEventArgs args)
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Delegate.Dynami
    cInvokeImpl(Object[] args)
       at System.Delegate.DynamicInvoke(Object[] args)
       at Telerik.Windows.RadRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at Telerik.Windows.RadRoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at Telerik.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RadRoutedEventArgs routedEventArgs)
       at Telerik.Windows.RouteItem.InvokeHandler(RadRoutedEventArgs routedEventArgs)
       at Telerik.Windows.EventRoute.InvokeHandlersImpl(Object source, RadRoutedEventArgs args, Boolean raisedAgain)
    n   at Telerik.Windows.EventRoute.InvokeHandlers(Object source, RadRoutedEventArgs args)
       at Telerik.Windows.RadRoutedEventHelper.RaiseEvent(DependencyObject element, RadRoutedEventArgs args)
       at Telerik.Windows.DependencyObjectExtensions.RaiseEvent(DependencyObject element, RadRoutedEventArgs e)
       at Telerik.Windows.Controls.RadPane.OnPinChange(PinChangeEventArgs args)
       at Telerik.Windows.Controls.RadPan
    e.ChangePin(Boolean isPinned)
       at Telerik.Windows.Controls.RadPane.OnIsPinnedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
    n   at Telerik.Windows.PropertyMetadata.<>c__DisplayClass1.<Create>b__0(DependencyObject d, DependencyPropertyChangedEventArgs e)
       at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object newValue, Object oldValue)
       at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isSetByStyle, Boolean isSetByBuiltInStyle, PropertyInvalidationReason reason)
       at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value)
       at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
       at Telerik.Windows.Controls.RadPane.set_IsPinned(Boolean value)
       at PetroWEB.Silverlight.Reports.ReportController.ShrinkOrGrowBottomTabPane()



    Here is the RadPane details

    OPEN, RIGHT BEFORE setting isPinned = TRUE

    {Telerik.Windows.Controls.RadPane}
        base {Telerik.Windows.Controls.RadTabItem}: {Telerik.Windows.Controls.RadPane}
        AutoHideHeight: 336.0
        AutoHideWidth: 853.0
        CanDockInDocumentHost: false
        CanFloat: false
        CanUserClose: false
        CanUserPin: false
        DocumentHostTemplate: {System.Windows.Controls.ControlTemplate}
        IsDockable: true
        IsDragging: false
        IsFloating: false
        IsHidden: false
        IsInDocumentHost: false
        IsLastInGroup: true
        IsPinned: false
        MenuCommands: Count = 5
        MenuItemTemplate: {System.Windows.DataTemplate}
        MenuItemTemplateSelector: null
        Title: "DataGrid"
        TitleTemplate: null
        TitleTemplateSelector: null

     

    CLOSE, RIGHT BEFORE setting isPinned = FALSE
    {Telerik.Windows.Controls.RadPane}
        base {Telerik.Windows.Controls.RadTabItem}: {Telerik.Windows.Controls.RadPane}
        AutoHideHeight: 0.0
        AutoHideWidth: 0.0
        CanDockInDocumentHost: false
        CanFloat: false
        CanUserClose: false
        CanUserPin: false
        DocumentHostTemplate: {System.Windows.Controls.ControlTemplate}
        IsDockable: true
        IsDragging: false
        IsFloating: false
        IsHidden: false
        IsInDocumentHost: false
        IsLastInGroup: false
        IsPinned: true
        MenuCommands: Count = 5
        MenuItemTemplate: {System.Windows.DataTemplate}
        MenuItemTemplateSelector: null
        Title: "DataGrid"
        TitleTemplate: null
        TitleTemplateSelector: null

    REOPEN, RIGHT BEFORE setting isPinned = TRUE (IT CRASHES RIGHT AFTER THIS)
      base {Telerik.Windows.Controls.RadTabItem}: {Telerik.Windows.Controls.RadPane}
        AutoHideHeight: 336.0
        AutoHideWidth: 853.0
        CanDockInDocumentHost: false
        CanFloat: false
        CanUserClose: false
        CanUserPin: false
        DocumentHostTemplate: {System.Windows.Controls.ControlTemplate}
        IsDockable: true
        IsDragging: false
        IsFloating: false
        IsHidden: false
        IsInDocumentHost: false
        IsLastInGroup: true
        IsPinned: false
        MenuCommands: Count = 5
        MenuItemTemplate: {System.Windows.DataTemplate}
        MenuItemTemplateSelector: null
        Title: "DataGrid"
        TitleTemplate: null
        TitleTemplateSelector: null


  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 30 Sep 2009 Link to this post

    Hello Casey,

    I weren't able to reproduce the problem. Here are the two scenarios I've tried:
    <Grid> 
        <Grid.RowDefinitions> 
            <RowDefinition /> 
            <RowDefinition Height="25" /> 
        </Grid.RowDefinitions> 
        <telerikDocking:RadDocking> 
            <telerikDocking:RadSplitContainer> 
                <telerikDocking:RadPaneGroup> 
                    <telerikDocking:RadPane Header="Pane" x:Name="pane"
                        <Button Content="PANE" /> 
                    </telerikDocking:RadPane> 
                </telerikDocking:RadPaneGroup> 
            </telerikDocking:RadSplitContainer> 
        </telerikDocking:RadDocking> 
     
        <StackPanel Orientation="Horizontal" Grid.Row="1"
            <Button Content="Change pane pin state 1" Click="Button1_Click" /> 
            <Button Content="Change pane pin state 2" Click="Button2_Click" /> 
        </StackPanel> 
    </Grid> 
    private void Button1_Click(object sender, RoutedEventArgs e) 
        this.pane.IsPinned = !this.pane.IsPinned; 
     
    private void Button2_Click(object sender, RoutedEventArgs e) 
        this.pane.IsPinned = false
        this.pane.IsPinned = true
        this.pane.IsPinned = false
        this.pane.IsPinned = true
        this.pane.IsPinned = false

    I did the testing with 2009.2.812 version and with the latest internal build version and it works fine.

    Could you please open a support and send us a project that reproduces the problem?

    Regards,
    Miroslav Nedyalkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. Casey
    Casey avatar
    27 posts
    Member since:
    May 2009

    Posted 30 Sep 2009 Link to this post

    Thanks,

    It is when I'm dynamically adding and removing tabcontrols and datagrids, removing them and then trying to recreate then and Pin the Pane. I'm sorry, but I can't send you my entire active project as it wouldn't work for you outside of our firewall.
    I've tried to create a test app that does the same thing, but it doesn't break...

    I've switched to using Height instead of Pinned and that is working for now.

    casey
  5. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 01 Oct 2009 Link to this post

    Hello Casey,

    I'll track the problem that you are experiencing and we will continue to try to reproduce it and I will update you when we have results. Please let us know if you succeed to reproduce the problem outside your application.

    Regards,
    Miroslav Nedyalkov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. James
    James avatar
    47 posts
    Member since:
    Jun 2009

    Posted 16 Dec 2009 Link to this post

    Hello Miroslav,
    I reproduced the same problem (version 2009.2.812.1030). the exception occurs in the event handler Page_Loaded when setting RadPane.IsPinned = true (before the RadPane.Loaded event triggers). If I set this after the RadPane.Loaded event, this won't happen.

    Regards
    James

  7. Andy
    Andy avatar
    2 posts
    Member since:
    Sep 2009

    Posted 16 Dec 2009 Link to this post

    Hi,

    There is a workaround solution by using .Dispatcher.BeginInvoke method:

    RadPenal.Dispatcher.BeginInvoke(() =>

    {
            pane1.IsPinned = true;
    }

    Cheers
    Andy

  8. Edward
    Edward avatar
    83 posts
    Member since:
    Feb 2011

    Posted 17 May 2012 Link to this post

    Is there any update, because this is still a problem on 2012 Q1 SP1.

    The Dispatcher method doesn't work.
  9. Ivo
    Admin
    Ivo avatar
    390 posts

    Posted 22 May 2012 Link to this post

    Hello Edward,

    We are not aware of such an issue with the Q1 SP1 version. It would be great if you open a support ticket and send us a sample runnable project reproducing this so we will be able to investigate it.

    All the best,
    Ivo
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top
DevCraft banner