Home Dashboard Directory Help
Search

WPF: Unable to add items to an empty grouped and sorted CollectionView by Richard Deeming


Status: 

Closed
 as Fixed Help for as Fixed


8
0
Sign in
to vote
Type: Bug
ID: 732930
Opened: 3/23/2012 12:36:28 PM
Access Restriction: Public
Moderator Decision: Sent to Engineering Team for consideration
1
Workaround(s)
view
0
User(s) can reproduce this bug

Description

I have a WPF ListBox bound to an ObservableCollection. I am using the IEditableCollectionViewAddNewItem interface to add new items to the collection.

If the CollectionView is grouped AND sorted, AND the underlying collection is empty, the first call to AddNewItem doesn't update the UI. The second call to AddNewItem results in an ArgumentOutOfRangeException.

If I remove the grouping, OR I remove the sorting, OR the collection is not empty, then the AddNewItem method works perfectly.

This problem also applies to the IEditableCollectionView.AddNew method.
Details
Sign in to post a comment.
Posted by Microsoft on 8/9/2012 at 4:01 PM
Hi Richard – We look at Connect feedback when we’re developing new .NET releases and service packs, but there are no service packs planned for .NET 4. For that reason, if you want a fix for .NET 4, you’ll need to submit a hotfix request via CSS as suggested earlier. Thanks again for the bug report.

-Microsoft .NET Framework Team
Posted by Richard Deeming on 5/24/2012 at 4:53 AM
I'm sorry; I was under the impression that the Connect site was about reporting bugs and getting them fixed in service packs, not just requesting improvements for future versions.

Presumably this means you're providing a new system for reporting bugs and getting them fixed in service packs? Or are you dropping the whole idea of service packs and forcing everyone to chase the latest version to get bugs fixed?
Posted by Microsoft on 5/23/2012 at 4:17 PM
The Connect site is for impacting the direction of future releases of Microsoft products. This issue is fixed in .Net 4.5.

Fixing issues in the actively developed product vs. fixing issues in released products are considerably different processes involving very different risks, costs, and decision criteria.

Hotfix or service pack requests for released products are handled through Microsoft Support. http://support.microsoft.com/kb/295539.

Thank you. -WPF team.
Posted by Richard Deeming on 5/22/2012 at 5:11 AM
With the recent confirmation [1] that .NET 4.5 will NOT run on XP or 2003, this bug is NOT fixed. We can't force our users to upgrade their OS just to fix a bug in .NET!

If you can't make 4.5 work on XP/2003, we need a service pack for 4.0 to fix these bugs.

[1] http://blogs.msdn.com/b/visualstudio/archive/2012/05/18/a-look-ahead-at-the-visual-studio-11-product-lineup-and-platform-support.aspx?PageIndex=4#comments
Posted by Richard Deeming on 3/28/2012 at 12:02 PM
Thanks for the update. Will this fix be available on machines running XP, 2003, Vista and 2008? The current beta release for 4.5 only works on 7, 8 and 2008 R2.
Posted by Microsoft on 3/28/2012 at 11:52 AM
Your app works correctly in the latest build of WPF 4.5. This issue must have been reported already, in some form.    Thanks for the feedback.

- Sam (WPF team)
Posted by MS-Moderator10 [Feedback Moderator] on 3/27/2012 at 2:27 AM
Thanks for your feedback.

We are rerouting 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 MS-Moderator01 on 3/23/2012 at 12:51 PM
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)
Posted by Richard Deeming on 3/23/2012 at 12:43 PM
I've attached a small demonstration of the problem.

The main window contains eight buttons, each testing a combination of options: AddNew vs AddNewItem, grouped vs not grouped, sorted vs not sorted.

The first three rows in both columns work as expected. The last row (grouped and sorted) demonstrates the problem.

If you uncomment line 24 from PersonList.cs, so that the ObservableCollection starts with one item, then all versions work as expected.
Sign in to post a workaround.
Posted by Jay Kidd on 1/10/2013 at 2:10 PM
If still using .NET 4, check if the underlying collection has any items, if not, add the item directly to the collection and call refresh or fire OnCollectionChanged; then you can use IEditableCollectionView / IEditableCollectionViewAddNewItem going forward.
File Name Submitted By Submitted On File Size  
TestListBox.zip 3/23/2012 11 KB