WPF virtualized control : {DisconnectedItem} reference when DataContext switch - by Rhodos

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 619658 Comments
Status Closed Workarounds
Type Bug Repros 16
Opened 11/6/2010 2:19:49 AM
Access Restriction Public


For the record, I am adding to connect a bug introduced by WPF 4 and described in the WPF Forum :


I am experiencing this bug on all virtualized DataGrids
Sign in to post a comment.
Posted by Deon [MSFT] on 4/29/2014 at 12:17 PM
Thank you for reporting this issue. This issue has been fixed in Visual Studio 2013. You can install a trial version of Visual Studio 2013 with the fix from: http://go.microsoft.com/?linkid=9832436
Posted by Microsoft on 5/8/2013 at 8:35 AM
"Next release" refers to .Net 4.5. If you're seeing DisconnectedItem while running with .Net 4.5, please open a new bug and attach a repro.
Posted by Morten Petteroe on 5/7/2013 at 11:49 PM
What is "next release"? Is it .Net 4.5?
Posted by Microsoft on 12/12/2012 at 11:00 AM
The fix: DataContextChanged is no longer raised when changing to {DisconnectedItem}.
To test an object: compare with BindingOperations.DisconnectedSource

I don't understand what you mean by "DisconnectedItem passed to the Loaded event"; it shouldn't appear as the "sender" nor in any property of the RoutedEventArgs. If this is a problem, please open a new bug and attach a repro.
Posted by skst on 12/11/2012 at 5:34 AM
This is marked as Closed and Fixed. What, exactly, was the fix? Is a DisconnectedItem no longer being passed to the DataContextChanged event? Is there a way to test if an object is a DisconnectedItem?

I'm seeing DisconnectedItem passed to the Loaded event in WPF 4.5, so it seems that this object is still being exposed.
Posted by Josef Bláha on 2/21/2012 at 2:05 AM
What do you mean by the next release? .NET 4.5, or some update for v4?
Posted by Ido Ran on 11/16/2011 at 1:38 PM
Can someone suggest a workaround please?
Posted by Microsoft on 7/7/2011 at 4:51 PM
In the next release, we will not raise DataContextChanged when changing to {DisconnectedItem}. We are also providing a way to check for {DisconnectedItem}.
Posted by W.Meints on 3/31/2011 at 5:57 AM
The same thing happens on controls that use a CollectionView as the items source. When you invoke the Refresh method on the CollectionView I get the same error.
Posted by Chrissteven81 on 2/25/2011 at 1:29 PM
I too am having this bug. I have a treeview bound to a collection. I have a lost focus event on the treeviewitems. when I delete an item the lost focus event occurs. it trys to use the data in the datacontext for the treeview item however, the datacontext is disconnected and I have not found a way to test for it.
Posted by Microsoft on 11/7/2010 at 6:44 PM

Thanks for your feedback. We are routing this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 11/6/2010 at 2:23 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)