Click here to Skip to main content
15,905,419 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Frnds,
I Have Two ListBoxes.....IN both boxes i have binded with datasource...
for example i have binded States of India in both List box....But in both list box states are different...i AM using two buttons to move selected datas in one listbox to another listbox...also selected datas to remove from the list box....

I got error as Items collection cannot be modified when the DataSource property is set.

I dont know how to modify the datasource datas
Posted
Updated 1-May-12 23:36pm
v4

Why can't you generate a second data set from the first one (rather than binding the same data set to both of them). Then you can bind the first one with one list box and the second data set to another list box
 
Share this answer
 
Comments
itsureshuk 2-May-12 5:47am    
Can you Explain Brief
You cannot modify the datasource collection for a list box directly.
Try removing the item from the list.
 
Share this answer
 
Comments
itsureshuk 2-May-12 6:08am    
How to remove items from the list...It shows same error

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900