Error HRESULT E_FAIL has been returned from a call to a COM component.

9 posts, 0 answers
  1. Hammad
    Hammad avatar
    4 posts
    Member since:
    Jul 2008

    Posted 19 Jan 2011 Link to this post

    Hi,

    I have a RadTreeView in my SL application, i am trying to remove an item from the TreeView but i get this exception

    Error HRESULT E_FAIL has been returned from a call to a COM component.
    System.Exception occurred
      Message=Error HRESULT E_FAIL has been returned from a call to a COM component.
      StackTrace:
           at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
           at MS.Internal.XcpImports.Collection_RemoveAt[T](PresentationFrameworkCollection`1 collection, UInt32 index)
           at System.Windows.PresentationFrameworkCollection`1.RemoveAtImpl(Int32 index)
           at System.Windows.Controls.ItemCollection.RemoveAtImpl(Int32 index)
           at System.Windows.Controls.ItemCollection.RemoveImpl(Object value)
           at System.Windows.Controls.ItemCollection.RemoveInternal(Object value)
           at System.Windows.PresentationFrameworkCollection`1.Remove(T value)
           at Transforms.Page.btn1_Click(Object sender, RoutedEventArgs e)
      InnerException:

    Any ideas? Workarounds etc??
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 19 Jan 2011 Link to this post

    Hi Hammad,

    This Exception can occur in wide variety of situations, so could you please elaborate more on your scenario. It would be best if you send us a runnable sample and we could provide you with an advice much faster.

    Best wishes,
    Petar Mladenov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  3. DevCraft banner
  4. Hammad
    Hammad avatar
    4 posts
    Member since:
    Jul 2008

    Posted 19 Jan 2011 Link to this post

    Hi,

    The item i am trying to remove has some RadTreeViewItem as childs, with Visibility property set to collapsed, when there is no such item in the RadTreeViewItem, it is removed sucessfully.

  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 19 Jan 2011 Link to this post

    Hi Hammad,

    I am unable to reproduce your issue in various basic scenarios. Supposing you scenario is more complex , we definitely need more info on how the tree is bound, whether virtualization is used, how the add/remove operations are implemented and etc.. But still, the best way for us to investigate in depth is to view a runnable sample demonstrating the issue you have come up with.

    Regards,
    Petar Mladenov
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
  6. JJ Loubser
    JJ Loubser avatar
    42 posts
    Member since:
    Jul 2009

    Posted 17 Mar 2011 Link to this post

     Row_.IsExpanded = oldRow_.IsExpanded;

    when  Row_.IsExpanded = false then set to true. Why?

    sometimes it worked, sometimes it gives this error:

    Error HRESULT E_FAIL has been returned from a call to a COM component.



    in

    http://www.telerik.com/community/forums/silverlight/treelist/radtreelistview-containerbinding-not-binding.aspx



  7. Aleksey Dyomin
    Aleksey Dyomin avatar
    3 posts
    Member since:
    May 2011

    Posted 11 Aug 2011 Link to this post

    Hi Hammad

    I have the same trouble, the only workaround i found is to clear binding to ItemsSource property of RadTreeView before you change collection and bind it again after.
  8. Pavel Pavlov
    Admin
    Pavel Pavlov avatar
    2039 posts

    Posted 11 Aug 2011 Link to this post

    Hi guys,

    Are we talking about RadTreeView or RadTreeListView ? Anyway, I believe we could be in help here in case we can obtain a small runnable repro project that exposes the issue.

    Regards,
    Pavel Pavlov
    the Telerik team

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

  9. Aleksey Dyomin
    Aleksey Dyomin avatar
    3 posts
    Member since:
    May 2011

    Posted 11 Aug 2011 Link to this post

    Hi Pavel

    I try to create solution, unfortunately i cant reproduce it. I only can attach my stack trace
    в MS.Internal.XcpImports.CheckHResult(UInt32 hr)
       в MS.Internal.XcpImports.Collection_RemoveAt[T](PresentationFrameworkCollection`1 collection, UInt32 index)
       в System.Windows.PresentationFrameworkCollection`1.RemoveAtImpl(Int32 index)
       в System.Windows.Controls.VirtualizingPanel.RemoveInternalChildRange(Int32 index, Int32 range)
       в Telerik.Windows.Controls.TreeView.TreeViewPanel.RemoveChildRange(GeneratorPosition position, Int32 itemCount, Int32 itemUICount)
       в Telerik.Windows.Controls.TreeView.TreeViewPanel.OnItemsRemove(ItemsChangedEventArgs args)
       в Telerik.Windows.Controls.TreeView.TreeViewPanel.OnItemsChanged(Object sender, ItemsChangedEventArgs args)
       в System.Windows.Controls.VirtualizingPanel.OnItemsChangedInternal(Object sender, ItemsChangedEventArgs args)
       в System.Windows.Controls.VirtualizingPanel.OnItemsChangedHandler(Object sender, ItemsChangedEventArgs args)
       в System.Windows.Controls.Primitives.ItemsChangedEventHandler.Invoke(Object sender, ItemsChangedEventArgs e)
       в System.Windows.Controls.ItemContainerGenerator.RemoveItem(Object item, Int32 itemIndex, DependencyObject container, Int32 containerCount, GeneratorPosition position, ItemBlock block, Int32 offsetFromBlockStart, Boolean raiseReplaceInsteadOfRemove)
       в System.Windows.Controls.ItemContainerGenerator.OnItemRemoved(Object item, Int32 itemIndex, Boolean raiseReplaceInsteadOfRemove)
       в System.Windows.Controls.ItemContainerGenerator.System.Windows.Controls.ICollectionChangedListener.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
       в System.Windows.Controls.WeakCollectionChangedListener.SourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
       в System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
       в System.Windows.Controls.ItemCollection.NotifyCollectionChanged(NotifyCollectionChangedEventArgs e)
       в System.Windows.Controls.ItemCollection.System.Windows.Controls.ICollectionChangedListener.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
       в System.Windows.Controls.WeakCollectionChangedListener.SourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
       в System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
       в System.Collections.ObjectModel.ObservableCollection`1.RemoveItem(Int32 index)
       в System.Collections.ObjectModel.Collection`1.Remove(T item)
  10. Richard
    Richard avatar
    8 posts
    Member since:
    Jul 2012

    Posted 02 Apr 2012 Link to this post

    row.IsExpanded = true will throw this error if row.IsExpandable = false
Back to Top
DevCraft banner