Arg_COMException when row's expanded state binding to the IsExpanded property

1 posts, 0 answers
  1. peter
    peter avatar
    9 posts
    Member since:
    Jun 2012

    Posted 01 Nov 2011 Link to this post

    The Arg_COMException will occur when I binding the row.isexpanded property,  and when you expand all children and using scrolling bar to  browse the items. the Arg_COMEXCEPTION will occure. Is there a way to avoid this problem?

    private void TreeListViewControl_RowLoaded(object sender, RowLoadedEventArgs e)
    {
      var row = e.Row as TreeListViewRow;
      if(row != null)
      {
        row.SetBinding(TreeListViewRow.IsExpandedProperty, new Binding("IsExpanded")
        { Source = row.Item, Mode = BindingMode.TwoWay });
      }
    }

    Stacktrace:

    at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
       at MS.Internal.XcpImports.Collection_Clear[T](PresentationFrameworkCollection`1 collection)
       at System.Windows.PresentationFrameworkCollection`1.ClearImpl()
       at System.Windows.PresentationFrameworkCollection`1.Clear()
       at Telerik.Windows.Controls.GridView.GridViewBaseVirtualizingPanel.OnItemsChangedInternal(Object sender, ItemsChangedEventArgs args)
       at Telerik.Windows.Controls.GridView.GridViewBaseVirtualizingPanel.OnItemsChangedHandler(Object sender, ItemsChangedEventArgs args)
       at Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.OnRefresh()
       at Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.Refresh()
       at Telerik.Windows.Controls.GridView.GridViewDataControl.OnItemsChanged(NotifyCollectionChangedEventArgs e)
       at Telerik.Windows.Controls.GridView.BaseItemsControl.OnItemCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
       at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
       at Telerik.Windows.Data.DataItemCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
       at Telerik.Windows.Data.DataItemCollection.OnCollectionViewCollectionChanged(NotifyCollectionChangedEventArgs e)
       at Telerik.Windows.Data.DataItemCollection.Telerik.Windows.Data.IWeakEventListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.ReceiveWeakEvent(Object sender, NotifyCollectionChangedEventArgs e)
       at Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args)
       at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
       at Telerik.Windows.Data.QueryableCollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
       at Telerik.Windows.Data.HierarchicalCollectionView.RefreshOnExpandCollapse(IHierarchicalChildCollectionView expandedView)
       at Telerik.Windows.Data.HierarchicalCollectionView.ExpandItem(Object item)
       at Telerik.Windows.Controls.RadTreeListView.ToggleHierarchyItemExpandStateInHierarchyViewFromUI(Object hierarchyItem, Boolean isExpanding)
       at Telerik.Windows.Controls.TreeListView.TreeListViewRow.OnIsExpandedChanged(Boolean oldValue, Boolean newValue)
       at Telerik.Windows.Controls.GridView.GridViewRow.OnIsExpandedChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
       at Telerik.Windows.PropertyMetadata.PropertyChangeHook.OnPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
       at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object oldValue, Object newValue)
       at System.Windows.DependencyObject.UpdateEffectiveValue(DependencyProperty property, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, ValueOperation operation)
       at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isBindingInStyleSetter)
       at System.Windows.Data.BindingOperations.SetBinding(DependencyObject target, DependencyProperty dp, BindingBase binding)
       at System.Windows.FrameworkElement.SetBinding(DependencyProperty dp, Binding binding)
       at UIBase.Controls.NecTreeListContainer.TreeListViewControl_RowLoaded(Object sender, RowLoadedEventArgs e)


    thanks,
    Jeff
Back to Top