hi friends
i have a problem.these are some components that i have in my project:
form1:datagridview1(dg1) , form2:datagridview2(dg2)
when i clicked on cell on dg1, form2 will be opened.now i have to double clicked on the cell of dg2 to send its data to dg1 on form1(then form2 will be closed).up to here there is no problem.but suppose when i choose a cell from dg2 and see it in dg1 i understand that i choose wrong cell from dg2.so i have to do same process as i told to choose right data again(click on dg1 cell,form2 will be opened and ...).if this happen several time i face this error:

Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore function

and it's from:dg2.DataSource=....
what should i do?
thanks for your attention.

This might be helpful.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.