Article ID: 316568 - View products that this article applies to.
This article was previously published under Q316568
This article refers to the following Microsoft .NET Framework Class Library namespaces:
When you set the Sorted property of a ListBox control to True after you bind it to a datasource, you may receive the following exception:
An unhandled exception of type 'System.ArgumentException' occurred in system.windows.forms.dll.
Additional information: Can't modify the Items collection when the DataSource property is set.
To resolve this issue, set the Sorted property before you bind the ListBox to a datasource.
Steps to reproduce the problem
For more information about the ListBox.Sorted property and other properties pertaining to the ListBox class, browse to the following MSDN Web sites:
Article ID: 316568 - Last Review: December 6, 2006 - Revision: 2.7
Contact us for more help
Connect with Answer Desk for expert help.