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

Is there any solution using API to pass value from my windows form application to one datagridview control of other windows form application ?
Basically I need to fill one column of one datagridview from other windows form application.
Any help will be very appreciated.

Thanks in advance

What I have tried:

if there are TextBox control, I can pass without problem using WM_SETTEXT, with datagridview is my problem, I cannot find a solution
Posted
Updated 15-May-22 23:48pm

1 solution

No. To an external application, a DGV is just a collection of Windows - it doesn't appear as a single control at all. And that means you have no access to the data behind" the control which you need to start changing it.

The only practical way to do it is to modify both applications to communicate to each other - a Socket is the usual approach.
Have a look here: Double Clicking a File in Explorer and Adding It to Your App while it's Running[^] - it's not exactly what you need, but it does show how to establish a Socket as a listener, and send data to it from another application.
   
Comments
Miucin Marian Sebastian 16-May-22 6:09am
   
Thanks for your suggestion and explanation.

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