Server Error in Application

An unhandled exception occurred during the execution of the current web request
posts - 60, comments - 75, trackbacks - 50

My Links

News

Hire Me Direct My Bookmarks

Archives

Post Categories

ASP.NET

Items collection cannot be modified when the DataSource property is set.

Items collection cannot be modified when the DataSource property is set.

This exception

“Items collection cannot be modified when the DataSource property is set.”

occurs when you trying to add some text like “Select” or “None” in combo box (drop down list) in .NET framework window form control. There is no such way to add items in combo box’s items property after you set DataSource. To avoid this you can add one more item in your datasource. For example if you are trying to bind drop down list through DataSet then add one more row into DataSet. There is one more workaround for

“Items collection cannot be modified when the DataSource property is set.”

If you like? http://www.codeproject.com/KB/combobox/UnboundItemsComboBox.aspx Hope this will help you to solve the exception
“Items collection cannot be modified when the DataSource property is set.”

Print | posted on Wednesday, December 26, 2007 7:59 PM | Filed Under [ C# ]

Feedback

Gravatar

# re: Items collection cannot be modified when the DataSource property is set.

Can insert an item in combobox after setting datasource property
3/24/2008 7:40 PM | Pradeep
Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification:
 
 

Powered by: