Click here to Skip to main content
15,896,118 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a datagridview with a datasource from a bindingsource.
The problem is that i can only add a row once, I add the row programmaticly within a backgroundworker.

mybindingsourc.AddNew();<br />
myDataset.Tables["mytable"].Rows.add();


the two code lines above give the same problem.
Posted
Updated 9-Nov-10 0:14am
v2

1 solution

If I understand what you are doing and you want to insert the same row multiple time into the datagridview/bindingsource, you have to clone the row and insert the clone. The row is an instance of an object so to get individual copies of the object you must first get a new instance.
 
Share this answer
 

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