Click here to Skip to main content
15,922,145 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
when i click on find button in order form to find customer record. it will open customer form window, from there if i select data from grid view it should go back to order form and display that customer name i had select in grid view of customer form in c#

What I have tried:

i have no idea how to do this type of code. so please help me to solve this problem
Posted
Updated 29-Mar-18 1:34am
v2
Comments
F-ES Sitecore 29-Mar-18 7:26am    
I suggest you get a book on whatever technology it is you are using (the fact that you haven't said if these are web forms or win forms is concerning enough) and go through it to learn the basics and then feel free to ask specific questions about specific problems. You can't learn such a broad technology from scratch using questions on a forum.

Opening a form is easy:
C#
MyOtherForm f = new MyOtherForm();
if (f.ShowDialog() === DialogResult.OK)
   {
   string name = f.NameOfCustomer;
   ...
   }
And if you create a property on the second form, you can then access it from the first once the second closes.
Have a look here: Transferring information between two forms, Part 2: Child to Parent[^]
 
Share this answer
 
Comments
Member 11776570 29-Mar-18 8:05am    
not working i had done this only.
myform f=new myform();
f.showdialog();
OriginalGriff 29-Mar-18 8:19am    
And? What was / wasn't working?
What happened that you didn't expect, or didn't happen that you did?
Did you follow the link and read what it said?
Hi,

Firstly : You can add your current data to session and let that display on whatever form you require.

Secondly : You can use hidden fields to play with data.

Happy coding.!!!
 
Share this answer
 
Comments
Member 11776570 29-Mar-18 11:59am    
Sorry but there is no use of session.

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